[antlr-interest] @init actions in “C Target ” have problems with MSVS compilers
Alexander Stasenko
astasenko at gmail.com
Thu Mar 22 21:40:14 PDT 2007
I appreciate your help. Thanks everyone for useful suggestions (and
explanations!). Any of them can solve the issue.
In my specific situation, new "@declarations" rule looks appropriate solution.
So for example I can separate comment from pragma in the following grammar part:
// A comment in SISAL source begins with a percent sign and ends with a newline
// character.
// If the character immediately following a percent sign is a dollar sign, the
// comment is a compiler directive, or pragma.
PragmaComment @declarations {int isPragma = 0;} : '%' (
( '$' {isPragma = 1;} | ~('$' | '\n' | '\r') ) ~('\n' | '\r')*
)? '\r'? '\n' {
if (!isPragma) _channel=99; // ignores comment
};
P.S. ANTLR community is really great :
--
Best regards, Alexander.
More information about the antlr-interest
mailing list