[antlr-interest] Is ANTLR Hallucinating?

Terence Parr parrt at cs.usfca.edu
Mon Jun 25 18:04:33 PDT 2007


On Jun 26, 2007, at 4:33 AM, Randall R Schulz wrote:

> Hi,
>
> I have this production in an ANTLR grammar:
>
> clifFile
>   : clText * EOF
>   ;
>
>
> It elicits this error from ANTLR:
>
> warning(200): CLIF.g:1371:4: Decision can match input such as  
> "{EOF, Open}" using multiple alternatives: 1, 2
> As a result, alternative(s) 2 were disabled for that input
> warning(201): CLIF.g:1371:4: The following alternatives are  
> unreachable: 2
>
>
> Why is it talking about alternatives in a rule that has none?

The loopback is considered an alternative as it's, well, an  
alternative path. ;)  That seems *very* odd that ANTLR thinks it can  
match Open by exiting the (...)* loop.  Hmm...can clText match EOF by  
the way?

Ter



More information about the antlr-interest mailing list