[antlr-interest] nondeterminism problem

Xiangmin Wang xiang4232002 at yahoo.com
Fri Oct 11 19:29:49 PDT 2002

One solution is to grab TRUE and FALSE as IDENT, then test the string, as follows
IDENT.equals("TRUE") ==> tokenType = BOOLEAN_LITERAL and tokenValue = TRUE;
IDENT.equals("FALSE") ==> tokenType = BOOLEAN_LITERAL and tokeValue = FALSE;
else it is a IDENT token.
 Jack Hong <jack_xu_hong at yahoo.ca> wrote:Hi all, I get following warning messages when I run ANTLR: warning: lexical nondeterminism between rules IDENT and BOOLEAN_LITERAL uponpetal.g:0:  k==1:'F','T'
petal.g:0:  k==2:'A','R'
petal.g:0:  k==3:'L','U' related token definitions in my grammar file: BOOLEAN_LITERAL    :    "TRUE"    |    "FALSE"    ; IDENT    :    ( 'a'..'z' | 'A'..'Z' | '_') ( 'a'..'z' | 'A'..'Z' | '_' | '0'..'9')*    ;  Any idea of how to fix these two nondeterministic tokens will be greatly appreciated.  ThanksJack 
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 

Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos, & more
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20021011/b39a2fe1/attachment.html

More information about the antlr-interest mailing list