Re: Re: new experimental C++ parser (branch)
[email protected] (Gilles J. Seguin)
| Newsgroups | gmane.comp.documentation.synopsis |
|---|---|
| Message-ID | <[email protected]> |
On Sun, 2005-10-23 at 05:46 -0400, David Abrahams wrote: > [...] > From > http://synopsis.fresco.org/viewsvn/synopsis-Synopsis/branches/ > CxxParserRewrite/src/Synopsis/Parser.cc?rev=1593&r1=1593&view=log > it looks like you might be hand-coding an LR(2) recursive-descent > parser. I wonder if you considered generating your parser with > something like bison? That was the way GCC C++ parser tackle the problem, using bison. Bison is a bottom-up parser, using LALR technique. GCC is using recursive descent technique now. > It seems like there's a great deal of code > involved in lookahead, etc., that could be handled by a parser > generator, leaving you to tackle the really hard problems (name > lookup, overload resolution, etc.) LL grammar that help resolve the C++ ambiguities are using technique like semantic/syntactic predicates. http://www.antlr.org/doc/metalang.html#SemanticPredicates hope this help.