Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Generated SyntacticSequencer in the serializer package(The init method of the class exceeds the 65535 bytes limit)
Generated SyntacticSequencer in the serializer package [message #1695793] Tue, 19 May 2015 10:33 Go to next message
Anakreontas Mentis is currently offline Anakreontas MentisFriend
Messages: 85
Registered: October 2014
Member
Hello.

The init method of the SyntacticSequencer class of my language exceeds the 65535 bytes limit and does not compile. The method is short, it contains 63 lines of code. Some of the lines though are exceptionally long.

What approach would you suggest to reduce the size of the method? Perhaps if I split some grammar rules into sub-rules the method might get shorter. I do not understand how the grammar structure relates to the serializer code.
Re: Generated SyntacticSequencer in the serializer package [message #1695803 is a reply to message #1695793] Tue, 19 May 2015 12:12 Go to previous messageGo to next message
Anakreontas Mentis is currently offline Anakreontas MentisFriend
Messages: 85
Registered: October 2014
Member
The method creates member objects of type AbstractElementAlias. Some of the members have very lengthy names. One for example is 16400 characters long.
Re: Generated SyntacticSequencer in the serializer package [message #1695865 is a reply to message #1695803] Tue, 19 May 2015 20:43 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Which version of Xtext are you using?

Sebastian
--
Looking for professional support for Xtext, Xtend or Eclipse Modeling?
Find help at http://xtext.itemis.com or xtext(@)itemis.com
Blog: zarnekow.blogspot.com
Twitter: @szarnekow
Google+: https://www.google.com/+SebastianZarnekow
Re: Generated SyntacticSequencer in the serializer package [message #1695908 is a reply to message #1695865] Wed, 20 May 2015 08:52 Go to previous messageGo to next message
Anakreontas Mentis is currently offline Anakreontas MentisFriend
Messages: 85
Registered: October 2014
Member
version 2.8.2.v201504100559
Re: Generated SyntacticSequencer in the serializer package [message #1695960 is a reply to message #1695908] Wed, 20 May 2015 14:54 Go to previous message
Anakreontas Mentis is currently offline Anakreontas MentisFriend
Messages: 85
Registered: October 2014
Member
I found the reason why XText produces that huge method. For some grammar rules, I want to parse the source but do not need the result of the rule. I would call the rule from some other one without assigning the result to a variable. And this is why the serializer became huge. For each rule I did not store the result in the produced EMF object, the serializer code would increase. By naming the results, the generated serializer shrinked from 2MB to few KB and it compiles fine.
Previous Topic:Formatting2 (2.8.1): AbstractRegionAccess.regionForEObject
Next Topic:Possible to suppress UI elements in Xtext for batch mode execution of xtext?
Goto Forum:
  


Current Time: Fri Apr 26 12:26:22 GMT 2024

Powered by FUDForum. Page generated in 0.03842 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top