Related articles |
---|
Preprocessor suggestions waverly.edwards@genesys.com (2001-09-16) |
Re: Preprocessor suggestions ralph@inputplus.demon.co.uk (2001-09-20) |
Re: Preprocessor suggestions Olivier.Ridoux@irisa.fr (Olivier Ridoux) (2001-09-20) |
From: | waverly.edwards@genesys.com (Waverly) |
Newsgroups: | comp.compilers |
Date: | 16 Sep 2001 00:34:12 -0400 |
Organization: | http://groups.google.com/ |
Keywords: | C, question |
Posted-Date: | 16 Sep 2001 00:34:12 EDT |
I'd like to start a translator program from C to a much less
expressive language. My first step would be to modify the c
preprocessor so that it doesnt swallow up the comments. Anyone see a
problem with trying to do this. This will be a first for me so I don't
have any insight into potential pitfalls.
Can you treat a comment as though it were a token?
Also in reading the Fraser & Hanson's Retargetable compiler book, the
preprocessor is almost non-existent. Does the preprocessor handle
trigraphs? Is it ANSI compliant or would it be pre-ANSI?
Novice at the wheel.
W.
[Leaving comments in the preprocessed code is easy enough, but keeping
comments in a parser is surprisingly tricky. My usual advice is to
have a comment field on each token structure and hang comment text on
the preceding or following token. -John]
Return to the
comp.compilers page.
Search the
comp.compilers archives again.