[antlr-interest] Is ANTLR Hallucinating?
Randall R Schulz
rschulz at sonic.net
Tue Jun 26 05:50:40 PDT 2007
On Monday 25 June 2007 23:12, Wincent Colaiuta wrote:
> El 25/6/2007, a las 21:13, Randall R Schulz escribió:
> > On Monday 25 June 2007 12:04, Wincent Colaiuta wrote:
> >> El 25/6/2007, a las 20:33, Randall R Schulz escribió:
> >>> 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?
> >>
> >> ...
>
> If you look in ANTLRWorks you'll see that there are indeed two paths,
> the first marked in green, and the other red. In order to be non-
> ambiguous there must be only a single, deterministic path.
I've done that, but there are no colors at all in the recognizer graph.
Again, I'm talking about the stand-alone ANTLRworks, not the IDEA
plug-in.
But I do see the implicit choice that arises when the parser must choose
whether to iterate or not.
Anyway, it's all moot. The grammar is so young, things have already
changed to the point that I'm not seeing that warning any more. In
fact, there were two such diagnostics, both now gone.
In all likelihood, given my inexperience with ANTLR, they and others
will come and go as well before my grammar is done...
> ...
>
> Cheers,
> Wincent
Randall schulz
More information about the antlr-interest
mailing list