[antlr-interest] problem with parser
jame vaalet
jamevaalet at gmail.com
Wed Sep 28 11:50:52 PDT 2011
hi,
below is my tree grammar:
tokens
{
COMMA=',';
LPAREN='(';
RPAREN=')';
}
start : (NUMBER^ COMMA NUMBER)|WORD^;
WORD : ~(WHITESPACE|LPAREN|RPAREN)+ ;
WHITESPACE : ('\t'|' '|'\r'|'\n'|'\u000C');
NUMBER : DIGIT+;
fragment DIGIT : '0'..'9' ;
when my input is 1,2 which one is it gonna match ? WORD or (NUMBER^ COMMA
NUMBER)
I want this to be matched to latter by antlr i matching it with former..
what am i missing here..
--
-JAME
More information about the antlr-interest
mailing list