
I haven't dealt explicitly with templates. I treat them as type
parameters (element $type-parameter). I don't check that they have
been declared at all. As explained, these are semantic checks and
should be deferred until type checking stage ;-)
Cheers,
Yin
On Wed, Feb 1, 2012 at 4:07 PM, Jason Dagit
On Wed, Feb 1, 2012 at 12:42 PM, Yin Wang
wrote: I have written a C++ parser in Scheme, with a Parsec-style parser combinator library. It can parse a large portion of C++ and I use it to do structural comparison between ASTs. I made some macros so that the parser combinators look like the grammar itself.
It's code is at:
http://github.com/yinwang0/ydiff/blob/master/parse-cpp.ss
A demo of the parse tree based comparison tool is at:
http://www.cs.indiana.edu/~yw21/demos/d8-3404-d8-8424.html
The bit of information I can tell you about parsing C++:
Thank you for the interesting response and example code (that I haven't had a chance to look at yet). How much support do you have for templates?
Jason