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

Francis ANDRE francis.andre.kampbell at orange.fr
Sat Sep 1 03:14:42 PDT 2012


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