[antlr-interest] EarlyExitException when token present

Mihai Danila viridium at gmail.com
Sun Nov 30 11:41:27 PST 2008


Hi,

Not sure if this is dummy level, but I can't figure out why the presence of
token Date messes up the parsing. When Date is present and not a fragment, I
get EarlyExitException on inputs like "123" and "123,456."

My question is primarily whether this is a bug or normal behavior. I'm sure
there are ways around it but this is part of a larger grammar and the "ways
around it" (declar Number token, make Date a rule, etc.) break other parts
of the grammar.

Thanks,
Mihai



grammar BugTest;

list: string (',' string)*;
string: (Alnum+);

fragment Digit: ('0'..'9');
Alnum: ('0'..'9') | ('a'..'z') | ('A'..'Z');
Date: (Digit Digit Digit Digit '-' Digit Digit '-' Digit Digit);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20081130/57bdb3a6/attachment.html 


More information about the antlr-interest mailing list