[antlr-interest] invalid StringTemplate % shorthand syntax: '%s'
Aurelian Melinte
ame01 at gmx.net
Sun Apr 6 17:32:49 PDT 2008
Hello,
I am getting the above mentioned error although I have escaped all the occurrences of % with \% but I still have a few of those errors. The only unescaped '%' are in the lexer:
MOD : '%' ;
MODEQUAL : '%=' ;
If someone can answer these questions, I would be grateful:
1. Why do I have to escape the % in C code? Are there any other characters that need to be escaped?
2. How do I escape it in the lexer tokens?
The grammar generating these errors can be found here: http://www.freeshells.ch/~amelinte/CPP_parser32m.g.
It is an attempt to adapt the C++ grammar authored by Mr. Wigg to ANTLR3; it generates other errors too, but for now I would like to get rid of these %-related errors.
On another note, this grammar crashes ANTLR.
Best regards,
Aurelian Melinte
More information about the antlr-interest
mailing list