[antlr-interest] Lexical nondeterminism with Decimal Literals

Herumor herumor at fastwebnet.it
Tue Jul 25 09:34:49 PDT 2006


Hello,
to avoid lexical nondeterminism in a rule like this with ANTLR 2.7.6
DecimalLiteral : Numberstring DOT Numberstring
Numbers : '0' .. '9'
NumberString : (Numbers)+
I created this rule instead

protected NUMBERS : ('0' | '1'..'9' ('0'..'9')*) (DOT ('0'..'9')+
{$setType(DECIMAL_NUMBERS);})? ;  


I wanna know if this way to do is OK or could generate troubles further.
Thanks forward for help.


More information about the antlr-interest mailing list