Re: java compile limitation?
- Using jdk 1.3.0_01 did not clear the compiler error. However, the
statements parser rule seemed to be the code in question and there
are many alternative statements. I broke this up into three rules
and that cleared the problem. Thank you for your information.
--- In firstname.lastname@example.org, Robert Colquhoun <rjc@t...> wrote:
> At 11:14 PM 12/30/00 +0000, stalnaker@a... wrote:
> >My grammar is now 39K and it has many key words. I now get a java
> >compiler error:
> >code too large for try
> >on catch recognition exception ex
> I think you've struck the 64kbytes method limit within the java
> machine. A single method cannot be more than 65535 bytes in size.
> There are some structures - the exception table, line number table
> others which i forget, only have 16bit(= max range of 65535 bytes)
> addresses. If your method had no try/catch blocks that span the
> method you might be able to get it to compile, but there is a
> likelihood the class file will not run on at least some VM's.
> You can use 'javap' to look at the raw bytecode to see the various
> sizes if you can get the thing to compile.
> >which seems to be at the end of a very large case statement in the
> >parser class.
> big case statements with lots of alternatives normally compile to
> 'tableswitch' or 'lookupswitch' opcode, interestingly both opcodes
> bit addresses which would allow much bigger methods, but occupy
> of real estate within the method itself.
> >This does not seem to be a computer RAM limitation in that closing
> >many open programs does not clear this problem.
> No i don't think it is a memory problem.
> >Please advise if this is a java limitation (sun 1.3 on win2k) such
> >that I need to consider changing the hosting language.
> I heard a rumor the latest jvm for windows 1.3.01 will execute at
> some large methods.
> Other than that i think the only way to fix it is to break up your
> is it possible to use different kind of tokens(ie less token
> perhaps use some token streams to process your tokens or a smarter
> PS I have been writing a basic to java bytecode compiler and the
> is a complete curse when trying to compile basic programs which are
> thousands of lines long and jump all over the place with gotos and
> gosubs. It seems to be only things which they added later to the
> cause the 64k limit rather than anything intrinsic to the machine
> they were in a hurry at the end of the project and really wanted
> or food or something... ;-).
> - Robert