Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Method createSequence is exceeding 65535
Method createSequence is exceeding 65535 [message #900477] Tue, 07 August 2012 05:07 Go to next message
Eclipse UserFriend
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 14:15 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Method createSequence is exceeding 65535 [message #901611 is a reply to message #900862] Mon, 13 August 2012 12:24 Go to previous message
Eclipse UserFriend
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 Nov 09 11:23:06 EST 2025

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

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

Back to the top