On Mar 30, 5:08 am, Chris F Clark <c...@shell01.TheWorld.com> wrote:
[...]> 2) One way to handle the language variation problems is to use> inheritance. To me, one of the grate innovations in OO> programming, was enabling the use of inheritance, which allows one> to build hierarchies, where A is like B except for the following> differences....

One family of tools that are particularly well suited for this
approach is parser generator libraries that embed their grammars, such
as Spirit for C++ (http://boost.org) or PLY for Python (http://
www.dabeaz.com/ply/).

With these you could define different grammar subsets and combine them
in different ways to be able to handle the different language
variants. I'm assuming that it's easy to tell upfront which variant
you need in each case, e.g. by reading a file header. Otherwise, if
you need to discover which variant applies while parsing, I expect
Hans-Peter Diettrich's approach to be better suited.