Re: Suggestion for dynamic grammar/parser - pls advise

"Nicola Musatti" <nicola.musatti@gmail.com>
30 Mar 2007 08:30:57 -0400

          From comp.compilers

Related articles
Suggestion for dynamic grammar/parser - pls advise jsassojr@nospam.com (John Sasso) (2007-03-29)
Re: Suggestion for dynamic grammar/parser - pls advise mailbox@dmitry-kazakov.de (Dmitry A. Kazakov) (2007-03-29)
Re: Suggestion for dynamic grammar/parser - pls advise DrDiettrich1@aol.com (Hans-Peter Diettrich) (2007-03-29)
Re: Suggestion for dynamic grammar/parser - pls advise cfc@shell01.TheWorld.com (Chris F Clark) (2007-03-29)
Re: Suggestion for dynamic grammar/parser - pls advise mefrill@yandex.ru (mefrill) (2007-03-30)
Re: Suggestion for dynamic grammar/parser - pls advise nicola.musatti@gmail.com (Nicola Musatti) (2007-03-30)
Re: Suggestion for dynamic grammar/parser - pls advise jsassojr@nycap.rr.com (John Sasso) (2007-03-30)
Re: Suggestion for dynamic grammar/parser - pls advise jsassojr@nycap.rr.com (John Sasso) (2007-03-30)
Re: Suggestion for dynamic grammar/parser - pls advise DrDiettrich1@aol.com (Hans-Peter Diettrich) (2007-04-01)
Re: Suggestion for dynamic grammar/parser - pls advise Meyer-Eltz@t-online.de (Detlef Meyer-Eltz) (2007-04-01)
Re: Suggestion for dynamic grammar/parser - pls advise Meyer-Eltz@t-online.de (Detlef Meyer-Eltz) (2007-04-01)
| List of all articles for this month |
From: "Nicola Musatti" <nicola.musatti@gmail.com>
Newsgroups: comp.compilers
Date: 30 Mar 2007 08:30:57 -0400
Organization: Compilers Central
References: 07-03-10607-03-113
Keywords: parse, tools
Posted-Date: 30 Mar 2007 08:30:57 EDT

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.


Cheers,
Nicola Musatti



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.