This package provides utilities for manipulating C programs.
The easiest way to get started using the C metaprogramming utilities is with the main module:
|(require (planet dherman/c:2:2))|
This module provides everything in the entire package. Subsequent sections of this manual describe the functionality of the individual libraries included, which can also be required individually.
|> (layout-offset (time 'tm) 'tm_year)|
This package includes:
A library of abstract syntax for the C99 language–see The C Language
A library for parsing C99 programs–see Parsing and Reading C
A (preliminary) library providing S-expression syntax for C–see Parenthetical C
A library for compiling and running C programs with an external compiler–see Evaluation
A library for compiling C header information–see Header Compilation
The parser does not recognize the C preprocessor. I may attempt to implement the preprocessor in the future, but there’s no guarantee at this point.
There is one major known bug in the parser: it does not currently recognize the production
This production causes a single shift/reduce conflict that I still have to track down.
The grammar does not support any extensions for GCC, MSVC, or any other specific C implementations. I intend to add support for these extensions on a by-need basis. Specific requests (as well as patches) are welcome.
External compilation is currently limited to GCC. I intend to add support for additional compilers on a by-need basis; patches are welcome.
Any other feedback may be emailed to me, Dave Herman, at firstname.lastname@example.org.
Version 0.1 (2009-02-01) - Initial release. Reasonably usable for header extraction.
Version 0.2 (2009-03-09) - Full C99 parser implemented.