[antlr-interest] distinquishing single from multiple characters

Michael Labhard ince at pacifier.com
Fri Feb 1 01:05:20 PST 2002

Question on Lexer.  The grammar (prolog) has two types of tokens both of 
which contain the same characters.  Specifically the "." may appear alone as 
the end token or it may appear together with other characters such as "$&%", 
etc. as a graphic token.  However, the rules:

GRAPHIC_TOKEN: ( options {greedy=true;} "." (GRAPHIC_CHAR)+ );


are flagged as ambiguous, even though in the graphic token case there must be 
at least 2 characters.  What is the best way to resolve such an ambiguity?  

-- Michael


Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 

More information about the antlr-interest mailing list