Hello,

I am trying to find a way to incorporate a preprocessor in the ANTLR 
flow. I thought of doing this before the lexer, but I need to tokenize 
the incoming char stream for macro substitution to be easy. I thought of 
doing it between the lexer and the parser, and replace the preprocessor 
tokens with their expansion before feeding the token stream to the 
parser, so I guess I would end up using something like the 
TokenRewriteStream??? Can someone steer me in the right direction 
please? Or should I be using lexer rule actions? In which case, any 
example on how to access the token stream of the replacement token list 
of an identifier? Too many questions sorry.

The language I am hoping to tokenize is SystemVerilog and has C-like 
preprocessor macros (`include, `ifdef, `define NAME(params,...), token 
concatenation, etc.).

Regards,
Martin


List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

-- 
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.

Reply via email to