It sounds like you have a stray apostrophe somewhere (mismatched string literal). It should be very easy to find if you open the grammar in a text editor that supports syntax highlighting for ANTLR grammars.
Sam -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of David Beckedorff Sent: Thursday, December 30, 2010 9:37 PM To: [email protected] Subject: [antlr-interest] ANTLR 3.3 Bug? Antlr-interest List, I'm trying to build a parser with the ANTLR IDE 2.1.1 Eclipse plugin and the ANTLR 3.3 library. I'm getting a bunch of cryptic error messages for some of my parser rules. For example, for this rule: tickSpec : 'TICK' '=' INTEGER ; I get: error(100): /EZM Project 01/src/com/dlb/ezm/ezm01/Ezm01.g:174:14: syntax error: antlr: unexpected token: ' ' |---> : 'TICK' '=' INTEGER and for the rule: location : ( 'LOC' '=' '(' numericalRange ',' numericalRange ')' ) | '$TITLE' | '$LEGEND' ; I get: error(100): /EZM Project 01/src/com/dlb/ezm/ezm01/Ezm01.g:182:15: syntax error: antlr: unexpected token: ' ' |---> : ( 'LOC' '=' '(' numericalRange ',' numericalRange ')' ) error(100): /EZM Project 01/src/com/dlb/ezm/ezm01/Ezm01.g:182:23: syntax error: antlr: unexpected token: ' numericalRange ' |---> : ( 'LOC' '=' '(' numericalRange ',' numericalRange ')' ) Why do I get an unexpected token ' ' error message for the whitespace between tokens like 'TICK' or 'LOC' and '=' ? Why doesn't ANTLR just absorb the whitespace and move on to the '=' token?? I have a whitespace rule in effect, namely: WS : (' '|'\t'|'\n'|'\r'|'\f')+ { $channel = HIDDEN; } ; -David Beckedorff List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address 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.
