Bug 413864 - Method specialStateTransition in internal lexer to large
Summary: Method specialStateTransition in internal lexer to large
Status: NEW
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.4.2   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-27 14:32 EDT by Malte Brunnlieb CLA
Modified: 2013-08-05 07:27 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Malte Brunnlieb CLA 2013-07-27 14:32:39 EDT
I wanted to generate an editor for a larger grammar.
Unfortunately this causes Internal<DSL>Lexer#specialStateTransition(int,IntStream) to be to large for the java compiler. I got the following error message: The code of method specialStateTransition(int, IntStream) is exceeding the 65535 bytes limit.

Maybe it is possible to extract each case into a seperate method?
Comment 1 Sven Efftinge CLA 2013-07-28 11:58:33 EDT
Please try to to turn on classSplitting for all the antlr fragments in your mwe file.

fragment = parser.antlr.XtextAntlrGeneratorFragment {
  options = {
    classSplitting = true
  }
}
Comment 2 Malte Brunnlieb CLA 2013-07-28 17:07:52 EDT
I've give it a try, but the issue persists.
Comment 3 Malte Brunnlieb CLA 2013-07-30 04:12:19 EDT
If have solved the issue for now by adapting the antlr java generator.
See the pull-request: https://github.com/antlr/antlr3/pull/123

Is it possible to temporarily change the antlr dependency for xtext such that I can insert my adapted antlr lib?
Comment 4 Malte Brunnlieb CLA 2013-07-30 05:41:14 EDT
I have changed the antlr-3.5 jar which is used as ANTLR runtime configured via the eclipse preferences -> ANTLR -> Builder.
However XText behaves like before as if this configuration does not have any impact on XText. Is this the case? Where can I configure the ANTLR Runtime for XText?
Comment 5 Sven Efftinge CLA 2013-08-05 07:27:07 EDT
(In reply to comment #4)
> I have changed the antlr-3.5 jar which is used as ANTLR runtime configured
> via the eclipse preferences -> ANTLR -> Builder.
> However XText behaves like before as if this configuration does not have any
> impact on XText. Is this the case? Where can I configure the ANTLR Runtime
> for XText?

Xtext doesn't use the antlr-plug-in for eclipse at all.
If you want to have a different ANTLR you need to put it into your target platform.