[antlr-interest] intermittent problem with lexer

Sean Proctor sproctor at gmail.com
Sun Mar 9 18:23:50 PDT 2008


Hello,

I've been using ANTLR in one of my projects for about 6 months. This problem
first started with some changes that I made 2 or 3 weeks ago. Removing the
old files and rerunning the build tool seemed to resolve it, but that
doesn't always.

Here is the error when I get it

    [java] ANTLR Parser Generator  Version 3.0.1 (August 13, 2007)
1989-2007
     [java] warning(205): cc/warlock/core/stormfront/script/wsl/WSL.g3:1:8:
ANTLR could not analyze this decision in rule Tokens; often this is because
of recursive rule references visible from the left edge of alternatives.
ANTLR will re-analyze the decision with a fixed lookahead of k=1.  Consider
using "options {k=1;}" for that decision and possibly adding a syntactic
predicate.
     [java] warning(209): cc/warlock/core/stormfront/script/wsl/WSL.g3:15:1:
Multiple token rules can match input such as "'<'": T33, T35, T37, STRING
     [java] As a result, tokens(s) STRING,T37,T35 were disabled for that
input
     [java] warning(209): cc/warlock/core/stormfront/script/wsl/WSL.g3:16:1:
Multiple token rules can match input such as "'>'": T34, T36, STRING
     [java] As a result, tokens(s) STRING,T36 were disabled for that input
     [java] warning(208): cc/warlock/core/stormfront/script/wsl/WSL.g3:17:1:
The following token definitions are unreachable: T35,T36,T37

I tried using an intermediate build from 2-27. The first warning went away
and the last one turned into an error. With the newer build, it seems that
the error never goes away.

The file in question is located here
http://fisheye.warlock.cc/browse/Warlock/warlock2/trunk/stormfront/cc.warlock.core.stormfront.script/src/main/cc/warlock/core/stormfront/script/wsl/WSL.g3?r=1693

The language itself is poorly structured, but I didn't create it.

Any suggestions would be greatly appreciated.

Sean
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080309/35629533/attachment.html 


More information about the antlr-interest mailing list