[antlr-interest] Need advice resolving internal error from createLookaheadDFA

Andy Tripp antlr at jazillian.com
Mon Aug 27 15:01:53 PDT 2007


I just struggled with this error today, too.

In my case, it was with a treewalker (not that it matters, I guess).
I had a rule like this:

a:  b*
  ;

b: (c d e)?
  ;

...where I have one rule refering to "zero or more" of another, and this 
other rule could be empty.
I simply made sure that the other rule could no longer be empty (removed 
the "?" from rule b).

And IIRC, the rule that seemed to be producing the error (the one that 
-Xwatchconversion shows)
was not the problem rule.

Andy


troy runkel wrote:
> I'm working on a large grammar and I'm seeing the following error
> message on several rules.
>
> error(10):  internal error:
> org.antlr.tool.Grammar.createLookaheadDFA(Grammar.java:864): could not
> even do k=1 for decision 197
>
> Using the -Xwatchconversion ANTLR option I'm able to determine which
> rule the error message applies to.  However, I'm not sure how to
> resolve the problem.
>
> Can anybody tell me what this error means and offer advice on how to
> resolve it.  Thanks.
>
> Troy Runkel
>
>   



More information about the antlr-interest mailing list