|An easy way to do C preprocessing! firstname.lastname@example.org (Thomas Hyldgaard M. Hansen) (1999-12-15)|
|From:||"Thomas Hyldgaard M. Hansen" <email@example.com>|
|Date:||15 Dec 1999 01:15:10 -0500|
Hi. From time to time I've seen people asking about how to do add C
preprocessing to their parser. An easy solution for that is the
CPreProcessorStream (Java based) that can now be download from
It is coded by extending an InputStream and all data read from the
stream is preprocessed - so so you can concentrate on setting up your
own grammer wo. the c preprocessing.
It also takes care of #include so to your parser it will appear as if
was reading one large file (there is a method for getting file name
and line number from a cumulated line number). Also it is possible to
just extract #define definitions from header files (filtering all
other C syntax away).
Have a look for yourself.
Return to the
Search the comp.compilers archives again.