[antlr-interest] False error 208?

Bood Qian boodweb at gmail.com
Mon Oct 24 01:29:11 PDT 2011


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.


More information about the antlr-interest mailing list