[antlr-interest] False error 208?

Jim Idle jimi at temporal-wave.com
Mon Oct 24 08:09:18 PDT 2011


parse    :    IF* EOF;


Jim

> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of Bood Qian
> Sent: Monday, October 24, 2011 1:29 AM
> To: antlr-interest at antlr.org
> Subject: [antlr-interest] False error 208?
>
> I don't understand why the following grammar leads to error 208
> complaining IF will be never matched
>
> ANTLRWorks 1.4.3
> ANTLT 3.4
> =====================
> grammar test;
>
> @lexer::members {
>   private boolean rawAhead() {
>   }
> }
>
> parse    :    IF*;
>
> RAW    :    ({rawAhead()}?=> . )+;
> IF      :    'if';
> ID    :    ('A'..'Z'|'a'..'z')+;
> ======================
>
> Either remove RAW rule or ID rule solves the error...
> >From my point of view, IF has the possibility to be matched.
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-
> email-address


More information about the antlr-interest mailing list