[antlr-interest] Big grammar => static initializer/method size is exceeding the 65535 bytes limit

Jim Idle jimi at temporal-wave.com
Tue Nov 3 12:28:19 PST 2009


I think that the issue is more likely something to do with your lexer specification. You should not need to worry about having lots of keywords, so one of the other rules must be causing the huge expansion. For instance I have problems with the complete lexer for TSQL, which has more keywords than you can shake a stick at. 

Did you ever post your complete lexer spec? I was out of the country when you first started this thread.

Jim

> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of Alex Marin
> Sent: Tuesday, November 03, 2009 10:43 AM
> To: Antlr interest
> Cc: Etools
> Subject: [antlr-interest] Big grammar => static initializer/method size
> is exceeding the 65535 bytes limit
> 
> Hello,
> 
> I've managed to find an automated solution for one of the previously
> reported errors, namely for:
> 
> The code for the static initializer is exceeding the 65535 bytes limit
> 
> The "fix" consists of modifying the StringTemplate that generates the
> parser code so that static initializers are automatically included in
> speparate classes (and properly referenced). By using static classes,
> all of the code is contained in a single file, so the change is
> transparent from a user's point of view.
> 
> You can find the modified code in the attached file.
> 
> Best regards,
> Alex Marin
> 
> PS: In order to use the fix you have to replace the Java.stg from
> org.antlr.codegen.templates.Java with this one and recompile antlr.





More information about the antlr-interest mailing list