Java 64K limitation in generated internal Lexer and other issueshttps://www.eclipse.org/forums/index.php/mv/msg/486054/1053280/#msg_1053280
I am facing several issues after running the workflow with the attached configuration (grammar, workflow and templates, if it has an impact).

My grammar is a bit large (it is generated following a quite simple pattern), but not so much, to me.

The Mwe2 configuration needs about 900MB Heap for the generation, but after about 25 minutes, no error message is reported.

However, the generated code does not compile:

As I were facing the Java 64K limitation already discussed in this forum, I configured the workflow with the following:

classSplitting=true
fieldsPerClass = "200"
methodsPerClass= "500".

But:

1- The generated Internal Parser has well been splitted within several classes, but not the generated Internal Lexer (both in UI and not UI parts) which shows the discussed error: "The code for the static initializer is exceeding the 65535 bytes limit".
2- The generated Internal Parser contains some code referencing rules that are defined in the same file, but in other classes.
3- The generated Parser (not Internal) of the UI part shows the following error for the Map nameMapping: "The code of constructor ) is exceeding the 65535 bytes limit". I thought that the methodsPerClass would have prevent this .

More surprising to me, if I am removing only the "methodsPerClass" config, I am getting the same issues, except issue #2- (the generated Internal Parser compiles correctly).

Thus, I am lost in trouble...
Has anyone already face the same and could give me a tip for all these issues ?
Is there samething is the way I am declaring my grammar that is wrong ?

Thanks]]>Vincent De Bry2013-05-03T14:03:38-00:00Re: Java 64K limitation in generated internal Lexer and other issueshttps://www.eclipse.org/forums/index.php/mv/msg/486054/1053298/#msg_1053298
I would try to move semantics out of the grammar. This will make the
grammar smaller and will give you an opportunity to present users with
something other than "syntax error" when there is something wrong. (e.g.
a typo in an enum will result in syntax error, compared to if it was say
a string that gets validated, then you can do nice things like "You
entered VLAUE, did you mean VALUE?"

Naturally it involves a bit of work to get code completion working (that
you now get for free in many cases).

Just my 2c.

- henrik

On 2013-03-05 16:03, Vincent De Bry wrote:
> Hi,
>
> I am facing several issues after running the workflow with the attached configuration (grammar, workflow and templates, if it has an impact).
>
> My grammar is a bit large (it is generated following a quite simple pattern), but not so much, to me.
>
> The Mwe2 configuration needs about 900MB Heap for the generation, but after about 25 minutes, no error message is reported.
>
>
> However, the generated code does not compile:
>
> As I were facing the Java 64K limitation already discussed in this forum, I configured the workflow with the following:
>
> classSplitting=true
> fieldsPerClass = "200"
> methodsPerClass= "500".
>
> But:
>
> 1- The generated Internal Parser has well been splitted within several classes, but not the generated Internal Lexer (both in UI and not UI parts) which shows the discussed error: "The code for the static initializer is exceeding the 65535 bytes limit".
> 2- The generated Internal Parser contains some code referencing rules that are defined in the same file, but in other classes.
> 3- The generated Parser (not Internal) of the UI part shows the following error for the Map nameMapping: "The code of constructor x() is exceeding the 65535 bytes limit". I thought that the methodsPerClass would have prevent this :(.
>
>
> More surprising to me, if I am removing only the "methodsPerClass" config, I am getting the same issues, except issue #2- (the generated Internal Parser compiles correctly).
>
>
> Thus, I am lost in trouble...
> Has anyone already face the same and could give me a tip for all these issues ?
> Is there samething is the way I am declaring my grammar that is wrong ?
>
> Thanks
>]]>Henrik Lindberg2013-05-03T16:35:14-00:00Re: Java 64K limitation in generated internal Lexer and other issueshttps://www.eclipse.org/forums/index.php/mv/msg/486054/1053308/#msg_1053308
I just cannot figure out why the generated Lexer is not splitted in several classes, whereas the Parser is.

And also why the references to rules defined outside of consumer classes are generated in Parser with methodsPerClass= "500"...

So why the generated code does not compile.
May be someone has an explaination ?]]>Vincent De Bry2013-05-03T18:36:08-00:00Re: Java 64K limitation in generated internal Lexer and other issueshttps://www.eclipse.org/forums/index.php/mv/msg/486054/1065700/#msg_1065700
Christian Mauceri2013-06-27T08:12:21-00:00