[antlr-interest] Can't figure out the ambiguity leading to this unreachable token def
Kamil Burzynski
nopik at data.pl
Sun Apr 6 01:06:29 PDT 2008
Hello,
Dan wrote:
> NAME: ('a'..'z' | 'A'..'Z' | '0'..'9')+;
>
> VALUE: ('a'..'z' | 'A'..'Z')+;
If lexer will see 'hi' in the input, it should produce NAME or VALUE?
This is the ambiguity, so ANTLR disabled second alternative (VALUE),
leaving only NAME. I think that if you would look into generated source
code, you would confirm that.
--
Best regards from
Kamil Burzynski
More information about the antlr-interest
mailing list