[antlr-interest] [BUG] 3.0b4 no complaint on parser reference to lexical fragment
Kay Roepke
kroepke at classdump.org
Sun Nov 12 15:45:31 PST 2006
On 13. Nov 2006, at 0:38 , John B. Brodie wrote:
> Sorry if this is a duplicate.
>
> This incorrect grammar draws no error report from org.antlr.Tool
Neither should it, IMHO.
Yes, it will fail to recognize just 'c' as input, but ANTLR can't be
certain that you didn't
have any actions that explicitely set the token type to C in some
other rule.
Throwing an error here would mean that you couldn't reference any
tokens from a @tokens
section, for instance.
cheers,
-k
More information about the antlr-interest
mailing list