[antlr-interest] ANTLR grammar processing returns strange warnings

Jim Idle jimi at temporal-wave.com
Wed May 20 07:57:12 PDT 2009


Yann Gauteron wrote:
> Dear ANTLR users,
>
> I am a happy (until now) new user of ANTLR. I learned ANTLR from
> scratch by reading the "The Definitive ANTLR Reference" book and
> trying to code a configuration file parser with ANTLR 3.1.3.
>
> While coding the grammar, I had no problem for converting grammar into
> Java until a certain moment, where I get lots of warnings similar to
> "warning(209): TestKO.g:450:1: Multiple token rules can match input
> such as "'T'" : ID_TFTPTIMESTAMP, ID_TFTPMODEMADDRESS,
> ID_TESTMODEENABLE, ID_TEKGRACETIME, SNMP_TIMETICKS, T_OID"
>   
Without looking at your grammar to see if these are real, I suggest that 
your lexer is too complicated for the default settings. Try:

java -jar path/to/jar -Xconversiontimeout 10000 T.g

If that does not work, then you have defined tokens that are indeed 
ambiguous.

Jim


More information about the antlr-interest mailing list