[antlr-interest] Oh my, code too large

Jim Idle jimi at temporal-wave.com
Tue Feb 19 09:55:14 PST 2008


IN 3.1 (coming soon now), you can take out parts of your grammar into
separate files, then use the import function to import say
‘xyzexpressions’ into your root grammar. You can use a snapshot of ANTLR
3.1 as it will be released quite soon. The imported grammars all occupy
their own class and so the issue goes away.

 

Jim

 

 

 

From: Alexander Gängel [mailto:alexander at gaengel.de] 
Sent: Tuesday, February 19, 2008 6:54 AM
To: antlr-interest at antlr.org
Subject: Re: [antlr-interest] Oh my, code too large

 

Is there any solution too this Problem?

I just run into it an now I'm not sure  how I can modify my Grammar to
get it to work.

Alexander

Fred schrieb: 

I have recently run into this (previously posted) problem and was
wondering what the status was?
There is a slight difference though, the error is found in a tree
grammar rather than a lexer.
 
"The problem is real.
Java effectively limits you to 65KBytes per method of byte-code.
The source of the limit is the definition of  the class files.
A class file includes, for each method, a table of  exception handlers,
and each of the entries in these tables includes the address
(in bytes relative to the beginning of the method) of the
beginning and end of the try-block, stored as two 16-bit integers.
There is no way around this.
I hope that there are people out there  who can make suggestions as to
how to modify your lexer to generate
less code."
Peace
- John
 
 
On Dec 13, 2007, at 2:51 PM, Andreas Ravnestad wrote:
 
  

   On 12/13/07, Andreas Ravnestad <andreas.ravnestad at gmail.com>
   wrote:
       

      Sometimes ANTLR generates a lexer which will make javac choke on
      itself with a message resembling this:
       
       code too large
          public int specialStateTransition(int s, IntStream
      input)throws
            

NoViableAltException {
 
  

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080219/b1133f57/attachment.html 


More information about the antlr-interest mailing list