Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Method createSequence is exceeding 65535
Method createSequence is exceeding 65535 [message #900477] Tue, 07 August 2012 09:07 Go to next message
Sergio Otero is currently offline Sergio OteroFriend
Messages: 37
Registered: June 2012
Member
Hi

I have a very large grammar (334 nodes) that is generating a class "XXXSequencer extends AbstractDelegatingSemanticSequencer" that has a method "createSequence" that is exceeding 65535 bytes.

This method is a big switch with all nodes in the grammar.

I've tried

options = {
classSplitting = true
methodsPerClass = "50"
fieldsPerClass = "50"
}

But it doesn't work. I've then taken a look to the xtext source code and it looks like it is always generated in one method.

There's a workaround to this problem?
Should i open a bug?

Thanks

Sergio
Re: Method createSequence is exceeding 65535 [message #900862 is a reply to message #900477] Wed, 08 August 2012 18:15 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13493
Registered: July 2009
Senior Member
Hi,

yes this sounds like a bug. the potions you posted have nothing todo with the serializer.
as a workaround you could try to patch SerializerFragment.xtend/AbstractSemanticSequencer.xtend

~Christian


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Method createSequence is exceeding 65535 [message #901611 is a reply to message #900862] Mon, 13 August 2012 16:24 Go to previous message
Sergio Otero is currently offline Sergio OteroFriend
Messages: 37
Registered: June 2012
Member
The problem was about Expressions, because in addition to OR, AND, NOT, PLUS, etc., more than 50 functions were expressions and the code generated for every one of this nodes was very large.

Expression_Compare returns Expression: 
	Expression_VariableName (
		(('>=') {Expression_Larger_Equal.left=current} right=Expression_VariableName) |
        otherthings;

Expression_function returns Expression: Expression_f1 | Expression_f2 | Expression_fn;

Expression_f1: 'F1' otherthings;
Expression_f2: 'F2' otherthings;
...
Expression_fn: 'FN' otherthings;


I've changed the grammar to group all functions in a single Expression node and avoid adding too many childs of Expression. Now it is far smaller and it works:

Expression_function returns Expression: exp=(Expression_f1 | Expression_f2 | Expression_fn);


Previous Topic:xbase2 - formatting line breaks
Next Topic:Coloring Comments
Goto Forum:
  


Current Time: Sun Jul 12 00:24:08 GMT 2020

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

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

Back to the top