[antlr-interest] Help: What does this mean?

Austin Hastings Austin_Hastings at Yahoo.com
Fri Nov 16 22:25:38 PST 2007


I get this warning:

   [antlr3] warning(200): 
/home/austin/gunit/sources/org/antlr/gunit/TestSuite.g:504:51: Decision 
can match input such as "'&&'" using multiple alternatives: 1, 2
   [antlr3] As a result, alternative(s) 2 were disabled for that input


For this code:

outputExpr_and returns [Assertion assertion]
    : op1=outputExpr_primary ('&&' op2=outputExpr_and)*
      {
        if (op2 == null)
        {
            $assertion = $op1.assertion;
        }
        else
        {
            $assertion = new Conjunction($op1.start, $op2.stop);
            $assertion.addClauses($op1.assertion, $op2.assertion);
        }
      }
    ;

I don't see two alternatives, unless the * is considered an alternative 
somehow. The 'outputExpr_primary' production is always something 
concrete, either a parenthesized subexpression or a list of keywords - 
never empty. So (1) what are "alternatives 1,2" for this case; and (2) 
how could I display them - is there a "painfully verbose" antlr switch I 
don't know about?

Thanks,

=Austin



More information about the antlr-interest mailing list