[antlr-interest] The code for the static initializer is exceeding the 65535 bytes limit

Edgar Jakumeit eja at arcor.de
Mon Sep 3 03:46:41 PDT 2012


Hi Francis,

when referencing in the java classpath the antlr plus the antlr-runtime 
you supplied, plus the string template v4, everything works fine (some 
additional classes are generated split off under new folders lexer and 
parser). The generated code compiles, and passes our vast test suites 
without error when executed.

But I must admit that we were using ANTLR 3.2 before and just going to 
3.4 brought it already below the 64k limit for us (was not done before 
as switching was breaking our include handling due to some subtle 
difference, and there was no need up till now to invest into finding out 
how to get around this).

Thanks for your effort
Regards
Edgar

Am 01.09.2012 12:14, schrieb Francis ANDRE:
> Hi Edgar
>
> Give it a try and if that's ok for you, I will send you the patches as
> sources...
>
> This patch does not work for a grammar which is generated at the top
> level of a java application, i.e, the default no package. This is
> related to a javac problem which is unable to solve an import foo.*; as
> the top level.But it works as soon as your grammar produces java code
> within a package.
>
> If you are using a SharedState type, you must add its reference in the
> options block as
>
> 'SharedStateType' '=' <YourSharedStateType> ';'
>
> options {
>       language = Java;
>      k=2;
>      ASTLabelType=CommonTree;
>      TokenLabelType=Lexem;
> _SharedStateType=SharedState;_
> }
>
>
> Let me know if it works or if you have any problem
>
> The jars are under the wiki page
>
> http://www.antlr.org/wiki/display/ANTLR3/The+64K+syndrome%3A++The+code+for+the+static+initializer+is+exceeding+the+65535+bytes+limit
>
> Francis
>
>
> Le 31/08/2012 22:26, Edgar Jakumeit a écrit :
>> Hi,
>>
>> I just ran into the very same issue "problem about the code for the
>> static initializer is exceeding the 65535 bytes limit" Zhaohui Yang
>> posted 2 weeks ago, but the code I'm working with (the graph rewrite
>> generator GrGen.NET) is public, so given the grammar file at
>> https://bitbucket.org/eja/grgen/src/20956f86416f/frontend/de/unika/ipd/grgen/parser/antlr/GrGen.g
>> I'd like to express my interest in
>> a) the free pointers offered by Jim
>> b) the patch offered by FA
>> (Note: the grammar builds the AST directly from the semantic actions.)
>>
>> After 9 years of contributions of different people and a target which
>> moved beyond what was originally envisioned the grammar is not as lean
>> as one could hope for, but I don't think it's so bad the parser
>> generator (better: the code generated) should fail.
>>
>> Regards
>> Edgar
>>
>> List:http://www.antlr.org/mailman/listinfo/antlr-interest
>> Unsubscribe:http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>>
>



More information about the antlr-interest mailing list