|Parser then Attribute Grammar for C++ firstname.lastname@example.org (2004-02-08)|
|Re: Parser then Attribute Grammar for C++ email@example.com (2004-02-12)|
|From:||firstname.lastname@example.org (Dez Akin)|
|Date:||8 Feb 2004 22:08:49 -0500|
|Keywords:||C++, parse, question|
|Posted-Date:||08 Feb 2004 22:08:49 EST|
I've been looking into constructing a compiler front end for C++, and
how to do it. After doing some reading on various grammers and parser
generators, Boost Spirit looks promising (an LL(k) recursive decent
parser) but another paper I read called "A Generated Parser of C++" by
Warwick Irwin and Neville Churcher seems to indicate that there are
semantic constructs that are necissary to be inferred before parsing
What I'm interested in is if its possible to do the parsing of C++ in
stages, making a regular grammar for the lexer, a LL(k) grammmer for
the first parser, and an attribute grammar to decorate the resulting
syntax tree, or if the semantic ambiguities in C++ actually prevent
such a clean layering.
If you can do it this way, is there a formal notation for Attribute
grammars analagous to EBNF for context free grammars?
Also given that regular grammars are a subset of LL(1) grammars are a
subset of LR(1) grammars are a subset of arbitrary context free
grammars, can you have a layered universal parser that runs better
than the O(n^3) Early algorithm by breaking up the grammar into its
modular lexical, LL(1), LR(1), and CFG components? Then extend this to
context sensitive grammars?
Return to the
Search the comp.compilers archives again.