[antlr-interest] Re: How to deal with languages with preprocessor s?

micheal_jor open.zone at virgin.net
Fri Apr 5 12:09:25 PST 2002


Hi Monty,

Thanks for your comments....

--- In antlr-interest at y..., mzukowski at b... wrote:
> > Any ideas please?. How to deal with the preprocessor directives 
in 
> > C/C++ and C#.
> 
> For the GCC parser I run the preprocessor externally.

What does this mean?. What preprocessor do you run externally?. Is it 
a separate Lexer/Parser that you generated using ANTLR as well?

> If you prefer to do
> it yourself then you might want to make it a filter stream.

I'll search the FAQ for "filter stream". Thanks.

> If all you want
> to do is some includes, then you can handle that in the parser by 
opening a
> new parser and lexer, feeding it the included filename, then 
attaching the
> resulting tree to your current tree.

Thanks. I would need to hndle the whole gamut of preprocessor 
directives in the C language family.

> > Is this handled in the Lexer or in the Parser. Any [simple-ish or 
> > clear] examples please?
> 
> If there's not an example in the examples directory then there is 
probably a
> FAQ about it.

I haven't found one in the FAQ I downloaded yet. I'll keep looking.

Thanks

Micheal



 

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



More information about the antlr-interest mailing list