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
--
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.