you could also override the nextToken method in your lexer class to overread 
tokens until a flag (maybe skip) becomes false:

.@Override
.Token nextToken() {
.       do {
.          Token = super.nextToken();
.      } while (skip == true || token == #if | token == #endif );
.       return token;
.}


And in your lexer rules for '#if' and '#endif' you set skip according to the 
expression result. And you have to parse your expression to do that. So after 
reading the text after '#if' until the end of the line, parse this text to get 
the result and set your flag.

cheers
 Michael

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