[antlr-interest] Failure on OpenJDK on Debian

Gavin Lambert antlr at mirality.co.nz
Tue Mar 31 11:56:34 PDT 2009


At 02:44 1/04/2009, Ola Bini wrote:
 >I have a grammar that works well with several different Java 5 
and
 >Java 6 environments on both Windows, Linux and MacOS X 
(including
 >SoyLatte).  But I've just got a bug report that it blows up on
 >OpenJDK build 1.6.0_0-b11, that can be installed in Debian.
 >Has anyone else seen this? The errors look like this:
 >
 >generate.antlr:
 >
 >     [java] warning(200): ioke.g:269:5: Decision can match input 

 >such as "'#'" using multiple alternatives: 1, 2
 >     [java] As a result, alternative(s) 2 were disabled for that 

 >input
 >     [java] error(201): ioke.g:269:5: The following alternatives 

 >can never be matched: 2
 >     [java]
 >     [java] warning(209): ioke.g:323:1: Multiple token rules can 

 >match input such as "'#'": T__38, Identifier, StringLiteral,
 >RegexpLiteral, LineComment
 >     [java]
 >     [java] As a result, token(s)
 >Identifier,StringLiteral,RegexpLiteral,LineComment were disabled 

 >for that input
 >     [java] warning(209): ioke.g:202:1: Multiple token rules can 

 >match input such as "'['": T__34, Identifier
 >     [java]
 >     [java] As a result, token(s) Identifier were disabled for 
that
 >input
 >     [java] warning(209): ioke.g:202:1: Multiple token rules can 

 >match input such as "'{'": T__36, Identifier
 >     [java]
 >     [java] As a result, token(s) Identifier were disabled for 
that
 >input
 >     [java] Java Result: 1

Looks like your lexer rules are ambiguous (which probably isn't 
helped by the fact that you're also using literals in your parser 
rules).  You should definitely consider correcting your rules so 
that the ambiguity warnings go away; doing that should make the 
error go away as well.



More information about the antlr-interest mailing list