Re: new experimental C++ parser (branch)
David Abrahams <[email protected]>
| Newsgroups | gmane.comp.documentation.synopsis |
|---|---|
| Message-ID | <[email protected]> |
Stefan Seefeld <[email protected]> writes: > hi there, > > after getting biten a number of times by the C++ parser not > being able to parse template-heavy code I'm working on, I > realized that there was only so much that could be done > to fix the existing C++ parser. > > After having dragged the idea around for a couple of weeks > I now created a new branch and committed some initial code > in an attempt to rewrite the C++ parser from scratch to make > it 'more' standard conformant. > > The branch can be seen here: > > http://synopsis.fresco.org/viewsvn/synopsis-Synopsis/branches/CxxParserRewrite/ Not being an expert with viewsvn (it looks like you can't diff a branch with the trunk?) I am having a hard time seeng exactly what you've been changing. 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? 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.) > The changes incure a number of modifications to the parse > tree structure, so at the moment there is probably not much that > will work in the new branch, beside the some simple developer tools > such as the display-ptree, display-symbols, and display-types applets. > > Obviously, any help to move this project forward would be more than > welcome. I might be interested, but I'd need to know more about your approach and its rationale first. -- Dave Abrahams Boost Consulting www.boost-consulting.com