An easy way to do C preprocessing!

"Thomas Hyldgaard M. Hansen" <>
15 Dec 1999 01:15:10 -0500

          From comp.compilers

Related articles
An easy way to do C preprocessing! (Thomas Hyldgaard M. Hansen) (1999-12-15)
| List of all articles for this month |

From: "Thomas Hyldgaard M. Hansen" <>
Newsgroups: comp.compilers
Date: 15 Dec 1999 01:15:10 -0500
Organization: CyberCity Internet
Keywords: C, Java

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.

Best regards
Thomas Hyldgaard

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.