[antlr-interest] Oh my, code too large

Fred phreed at gmail.com
Mon Feb 4 06:36:52 PST 2008


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 {


More information about the antlr-interest mailing list