[antlr-interest] ArrayIndexOutOfBoundsException in ANTLR 3.0

Gerard van de Glind g.vandeglind at beinformed.nl
Fri Aug 15 04:34:57 PDT 2008


Hi Kay and all,

I have tested it in 3.1 and it seems fixed.
Although version 3.1 causes some of my unit tests to fail now, I don't get an ArrayIndexOutOfBoundsException anymore for this particular test.

I will go on now to explore why some tests fail.

Thanks!

Regards, Gerard


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