[antlr-interest] Preprocessors - academic question

mzukowski at yci.com mzukowski at yci.com
Wed Jun 26 07:39:08 PDT 2002


One thing I did was allow preprocessor directives in my tree, and have my
tree parser know to walk down them, but it only had to handle include files.


I think in terms of trees you could have the original code and a tree for
each phase of the generated code.  At the root of the actual code which goes
into your AST you might have a reference to those intermediate trees of
processed code and the original unprocessed code.  Sounds like a real
headache to me, but I don't see why it wouldn't be possible.

Monty

> -----Original Message-----
> From: John Allen Green [mailto:greenj at ix.netcom.com]
> Sent: Wednesday, June 26, 2002 5:02 AM
> To: Antlr
> Subject: [antlr-interest] Preprocessors - academic question
> 
> 
> 
> Here's one for you educated folks...
> 
> Given a preprocessor which allows branching and unrestricted code
> substitutions, is it impossible to work with the semantics of the
> preprocessing itself?
> 
> It would seem to me that since you could have code 
> substitution doing code
> substitution, it would be impossible to build a parse tree of the
> preprocessing.
> 
> Cheers,
> John
> john at joanju dot com
> 
> 
>  
> 
> Your use of Yahoo! Groups is subject to 
http://docs.yahoo.com/info/terms/ 


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list