[plt-scheme] parsing/prettyprinting C

From: Dave Herman (dherman at ccs.neu.edu)
Date: Thu Mar 5 10:56:31 EST 2009

> Dave,
> Are there any plans to add function definitions?
> 
> I see it uses yacc.  The 2nd edition K&R has a grammar acceptable by
> yacc in appendix A, section A13.  Are there any difficulties to
> making this a complete parser other than "just typing it in" ?

Heh, if you can just hang on for another day or two I'm about to release 
a much more fully-featured C parser. I've implemented the full C99 
grammar, plus the standard extensions of allowing typedef names to be 
used as identifiers in unproblematic positions (e.g., as struct tags). I 
haven't released it yet but it's getting close.

No pretty printer implemented, though that's generally easier than 
parsing. And you could use my generic pretty-printing library for that:

http://planet.plt-scheme.org/display.ss?package=pprint.plt&owner=dherman

I'll notify you when I update the c.plt package to version 2:0. RSN.

Dave


Posted on the users mailing list.