Exception in thread "main" java.lang.ClassFormatError: (Code of a method longer than 65535 bytes)
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Stefan_Heimann
Posted On:   Friday, June 21, 2002 03:04 PM

Hi! I am new to antlr and so I just tried to implement a little lexer. Generating the code for the lexer and compiling the generated code works fine, but if I try to run the lexer I get the error message above. The generated java-source-file has a size of 67 KB, the class-file even 79 KB. That's too much, because of a limitation in the jvm. When I look into the generated source file, there is a variable private static final long _tokenSet_0_data_[] . This array is _really_ big, but it holds mainly the value -1. What am I doing wrong? Thanks for helping! Stefan    More>>

Hi!

I am new to antlr and so I just tried to implement a little lexer. Generating the code for the lexer and compiling the generated code works fine, but if I try to run the lexer I get the error message above.



The generated java-source-file has a size of 67 KB, the class-file even 79 KB. That's too much, because of a limitation in the jvm.



When I look into the generated source file, there is a variable private static final long _tokenSet_0_data_[] . This array is _really_ big, but it holds mainly the value -1.



What am I doing wrong?



Thanks for helping!



Stefan    <<Less

Re: Exception in thread "main" java.lang.ClassFormatError: (Code of a method longer than 65535 bytes)

Posted By:   Stefan_Heimann  
Posted On:   Friday, June 21, 2002 11:29 PM

Ok, I found the problem. It's the following rule:



protected ID_START_LETTER : '$' | '_' | 'a'..'z' | 'u0080'..'ufffe';

I changed it into



protected ID_START_LETTER : '$' | '_' | 'a'..'z' | 'A'..'Z';

and now the generated class has only a size of 2500KB and the variable that causes the problem now looks like
private static final long _tokenSet_0_data_[] = { 8935141106652287488L, 4611686013058678782L, 0L, 0L };



The rule above was taken from the unicode shipped with the antlr distribution. What am I doing wrong?



Bye
Stefan
About | Sitemap | Contact