conditionDirective
: conditionDirective ( CPP_AND | CPP_OR ) conditionDirective
| definedCondition
| LEFT_PAREN conditionDirective RIGHT_PAREN
| EXCAL conditionDirective
;
// ...
COMMENT: EXCAL .*? NEW_LINE+ -> skip;
EXCAL: '!';
#if defined A && ! defined B
--
You received this message because you are subscribed to the Google Groups "antlr-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to antlr-discussi...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
does ! for a comment have to start in a specific column?
PS: then of course use a semantic predicate to check the context like
DIRECTIVE_START: {flag = true} '#';
// ...
COMMENT: {$flag == false}? EXCAL .*? NEW_LINE+ -> skip;
// ...
fragment NEW_LINE: {if (!cpp_break) { flag = false; cpp_break = false; }} '\r'? '\n';
NEW_LINES: NEW_LINE+ -> skip;
BREAK_LINE: ( '&' | '\\' {cpp_break = true} ) WS? ( NEW_LINES | COMMENT ) -> skip;
You received this message because you are subscribed to a topic in the Google Groups "antlr-discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/antlr-discussion/83V-zAlmtYE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to antlr-discussi...@googlegroups.com.