Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Generated parser problem
Generated parser problem [message #742237] Thu, 20 October 2011 06:01 Go to next message
Mahmoud Moneeb is currently offline Mahmoud Moneeb
Messages: 15
Registered: October 2011
Junior Member

Hi,

I have implemented a DSL grammar rules ,that is relatively big, and everything went fine during building the project except that the generated parser in the UI project ("InternalMyDslParser.java") suffers from the huge number of static initialization of the rules and give me this error

"The code for the static initializer is exceeding the 65535 bytes limit"

any idea how can I resolve this issue ?!

Best regards,
Mahmoud
Re: Generated parser problem [message #742242 is a reply to message #742237] Thu, 20 October 2011 06:07 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 4426
Registered: July 2009
Senior Member
Hi,

did you already try a

            fragment = parser.antlr.XtextAntlrUiGeneratorFragment {
                options = {
                    classSplitting = true
                }
            }


~Christian
Re: Generated parser problem [message #742339 is a reply to message #742242] Thu, 20 October 2011 08:06 Go to previous messageGo to next message
Mahmoud Moneeb is currently offline Mahmoud Moneeb
Messages: 15
Registered: October 2011
Junior Member
Yes, It still giving the same error.

I'm wondering is it an issue because of the grammar rules size or there is a grammar rules implementation tips that can solve this issue ?

Best regards,
Mahmoud
Re: Generated parser problem [message #742364 is a reply to message #742339] Thu, 20 October 2011 08:33 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 4426
Registered: July 2009
Senior Member
Hi,
which Xtext version do you use?
https://bugs.eclipse.org/bugs/show_bug.cgi?id=349992

~Christian
Re: Generated parser problem [message #742367 is a reply to message #742364] Thu, 20 October 2011 08:35 Go to previous messageGo to next message
Mahmoud Moneeb is currently offline Mahmoud Moneeb
Messages: 15
Registered: October 2011
Junior Member
Hi,

I'm using the latest one 2.0.1 over platform: windows xp x86

Best regards,
Mahmoud
Re: Generated parser problem [message #742380 is a reply to message #742367] Thu, 20 October 2011 08:49 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 4426
Registered: July 2009
Senior Member
Did you try the fieldsPerClass = "500" stuff as the bugs tells?
Re: Generated parser problem [message #742391 is a reply to message #742380] Thu, 20 October 2011 08:56 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 4426
Registered: July 2009
Senior Member
Hi,

i just saw this

/**
* @since 2.1
*/
public int getFieldsPerClass() {
return fieldsPerClass;
}
/**
* @since 2.1
*/
public void setFieldsPerClass(String fieldsPerClass) {
this.fieldsPerClass = Integer.parseInt(fieldsPerClass);
}
/**
* @since 2.1
*/
public int getMethodsPerClass() {
return methodsPerClass;
}
/**
* @since 2.1
*/
public void setMethodsPerClass(String methodsPerClass) {
this.methodsPerClass = Integer.parseInt(methodsPerClass);
}



~Christian
Re: Generated parser problem [message #742396 is a reply to message #742380] Thu, 20 October 2011 09:00 Go to previous messageGo to next message
Mahmoud Moneeb is currently offline Mahmoud Moneeb
Messages: 15
Registered: October 2011
Junior Member
Yes, and still not working :S I added the configuration part to parser.antlr.XtextAntlrUiGeneratorFragment too.

I can see that the same generated code that produces the error is still implemented in the same way
Re: Generated parser problem [message #743137 is a reply to message #742396] Fri, 21 October 2011 02:51 Go to previous messageGo to next message
Elhamlaoui Mahmoud is currently offline Elhamlaoui Mahmoud
Messages: 246
Registered: March 2010
Senior Member
Hi Mahmoud,

You can try a temporary manual solution, that i posted here: http://www.eclipse.org/forums/index.php/t/237933/

Best regards,
Mahmoud
Re: Generated parser problem [message #743372 is a reply to message #742396] Fri, 21 October 2011 07:57 Go to previous messageGo to next message
Jan Kohnlein is currently offline Jan Kohnlein
Messages: 572
Registered: July 2009
Senior Member
We've fixed this issue in 2.1. Please try the HEAD revision or wait for
the release (early in November).


Am 20.10.11 15:00, schrieb Mahmoud Moneeb:
> Yes, and still not working :S I added the configuration part to
> parser.antlr.XtextAntlrUiGeneratorFragment too.
>
> I can see that the same generated code that produces the error is still
> implemented in the same way


--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Re: Generated parser problem [message #744781 is a reply to message #743372] Sat, 22 October 2011 06:33 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian Zarnekow
Messages: 2788
Registered: July 2009
Senior Member
Hi Mahmoud,

I strongly encourage you to try the head revision or attach your grammar
to a ticket. More test cases for the fix that we implemented could be
helpful.

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

On 21.10.11 13:57, Jan Koehnlein wrote:
> We've fixed this issue in 2.1. Please try the HEAD revision or wait for
> the release (early in November).
>
>
> Am 20.10.11 15:00, schrieb Mahmoud Moneeb:
>> Yes, and still not working :S I added the configuration part to
>> parser.antlr.XtextAntlrUiGeneratorFragment too.
>>
>> I can see that the same generated code that produces the error is still
>> implemented in the same way
>
>
Re: Generated parser problem [message #746249 is a reply to message #744781] Sun, 23 October 2011 05:44 Go to previous message
Mahmoud Moneeb is currently offline Mahmoud Moneeb
Messages: 15
Registered: October 2011
Junior Member
Hi,

I have tried the head revision 2.1 but the same problem is still there.

I reported the problem and attached the grammar that generates it here ..

https://bugs.eclipse.org/bugs/show_bug.cgi?id=361746

I'll try Mahmoud's manual solution for now and hope it would work.

Thanx all,
Mahmoud
Previous Topic:Xbase - Differ between Statements and Expressions
Next Topic:Java validators
Goto Forum:
  


Current Time: Fri May 24 11:44:12 EDT 2013

Powered by FUDForum. Page generated in 0.02086 seconds