[antlr-interest] ArrayIndexOutOfBoundsException in ANTLR 3.0

Kay Röpke kroepke at classdump.org
Thu Aug 14 06:33:40 PDT 2008


Hi!

On Aug 14, 2008, at 2:57 PM, Gerard van de Glind wrote:

> If I try to parse an invalid expression, e.g. 'DATE_FUNC()' then I  
> get the following stacktrace:
>
>                  java.lang.ArrayIndexOutOfBoundsException: -1
>                  at org.antlr.runtime.DFA.predict(DFA.java:44)


Could you try the grammar again with the recently released 3.1? The  
bug database shows a couple of DFA related fixes (although quite a  
while ago) which might still be in 3.0.1.
If it's still happening, could you provide the DFA for this decision?  
You can generate it with running:

java org.antlr.Tool -dfa YourGrammar.g

That will produce a lot of .dot files in that directory. They are  
numbered for each decision point, you can get the number in question  
from BIExpressionParser.java:5548 (note the dfaXXX.predict() line).  
The files will be name "GrammarName".dec-XXX.dot.
That will help to tell what's going wrong there.

 From a glance at DFA.java:44 it appears to be related to the  
predicate. That DFA should have a special state but it's missing.

cheers,
-k
-- 
Kay Röpke
http://classdump.org/








More information about the antlr-interest mailing list