[antlr-interest] Limitation of method size in Java target

A Z asicaddress at gmail.com
Wed Sep 15 11:52:34 PDT 2010


Hello,

  I have a somewhat large grammar that I just recently got compiling
with ANTLR with no problems most of the time. I still get timeout
errors occasionally. I'm now at the point where I'd like to run my
test suite against the grammar however the java compiler fails with
the following:

10. ERROR in /output/errorParser.java (at line 15)
        public class errorParser extends DebugParser {
                     ^^^^^^^^^^^
The code for the static initializer is exceeding the 65535 bytes limit


I found a thread from last year regarding this issue:

http://groups.google.com/group/il-antlr-interest/browse_thread/thread/f3a4ce6c3a5c803f

I tried a few combinations of the various settings however they either
caused the ANTLR compile to fail or did not resolve the java compile
issue. Is modifying the .java files the only reliable workaround at
this point? It looks like the 4000 "public static final BitSet
FOLLOW*' statements are the cause but I'm not sure how grammar coding
changes can reduce them.


Thanks


More information about the antlr-interest mailing list