Literals class is not created [message #485096] |
Thu, 10 September 2009 14:19  |
Eclipse User |
|
|
|
Hello Xtext Team
Our grammar is now quite large and I have hit an unusual problem with the generation.
When I generate the grammar, the Literals variable in the MyDslPackage is not created.
This error occurred while adding in another grammar element. For instance, adding a new enum type.
e.g. If I try and add one more grammar element:
enum ColourEnum:
red | blue;
The literals variable is not generated, however removing one enum option:
enum ColourEnum;
red;
works.
1. Is there a limit in the number of grammar elements allowed?
2. Would you have any ideas what could be the reason?
Thank you
Kind regards,
Dana
|
|
|
|
|
Re: Literals class is not created [message #485122 is a reply to message #485096] |
Thu, 10 September 2009 14:56   |
Sebastian Zarnekow Messages: 3118 Registered: July 2009 |
Senior Member |
|
|
Hi Dana,
assuming you are talking about the inner class Literals of a generated
EPackage:
I expect your metamodel to be quite large and I can imagine some fancy
optimizations in the genmodel generator that will produce other code
than usual.
Can you try to generate the model code manually for your metamodel and
confirm, that generation works even if you add another literal value or
something similar?
If you refer to EnumLiterals .. well I've no idea what might cause this
behaviour. If it would be possible for you to send me your metamodel or
a sample grammar, I'll have a look at it.
Regarding your first question:
There is no limit for the number of grammar elements, that I'm aware of.
Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Dana Wong schrieb:
> Hello Xtext Team
>
> Our grammar is now quite large and I have hit an unusual problem with
> the generation.
>
> When I generate the grammar, the Literals variable in the MyDslPackage
> is not created.
>
> This error occurred while adding in another grammar element. For
> instance, adding a new enum type.
> e.g. If I try and add one more grammar element:
> enum ColourEnum:
> red | blue;
>
> The literals variable is not generated, however removing one enum option:
>
> enum ColourEnum;
> red;
>
> works.
>
> 1. Is there a limit in the number of grammar elements allowed? 2.
> Would you have any ideas what could be the reason?
>
> Thank you
>
> Kind regards,
> Dana
|
|
|
Re: Literals class is not created [message #485135 is a reply to message #485122] |
Thu, 10 September 2009 15:25   |
Eclipse User |
|
|
|
Hi Sebastian,
Yes, the model generation works, the extra grammar elements I added have EClasses created. Just the inner interface Literals that is missing from my grammar's Package class.
However this problem isnt a stopper, and I can go on, I was just curious as to why it is missing.
Also the problem arises no matter what grammar element I add.
Many thanks,
Dana
|
|
|
Re: Literals class is not created [message #485140 is a reply to message #485122] |
Thu, 10 September 2009 15:26   |
Eclipse User |
|
|
|
GenPackage has a "Literals Interface" property that's set to false by
default for very large models (to avoid exceeding byte code limits).
Initialize by Loading it similarly set to true for large models, again,
to avoid exceeding byte code limits.
Sebastian Zarnekow wrote:
> Hi Dana,
>
> assuming you are talking about the inner class Literals of a generated
> EPackage:
> I expect your metamodel to be quite large and I can imagine some fancy
> optimizations in the genmodel generator that will produce other code
> than usual.
> Can you try to generate the model code manually for your metamodel and
> confirm, that generation works even if you add another literal value
> or something similar?
>
> If you refer to EnumLiterals .. well I've no idea what might cause
> this behaviour. If it would be possible for you to send me your
> metamodel or a sample grammar, I'll have a look at it.
>
> Regarding your first question:
> There is no limit for the number of grammar elements, that I'm aware of.
>
> Regards,
> Sebastian
|
|
|
|
|
Re: Literals class is not created [message #485170 is a reply to message #485157] |
Thu, 10 September 2009 17:05   |
Eclipse User |
|
|
|
Dana,
The generated edit code should reference it if it's not in the model.
I.e., both the generation of the interface and uses of it are keyed by
the same setting. Perhaps you need to regenerate the *.edit code?
Dana Wong wrote:
> Hello again
>
> Without the generated literals class, is there a flag in the genmodel
> file so that my Generated Edit code does not reference the literals
> class?
> Thanks again
> Dana
|
|
|
|
|
|
Re: Literals class is not created [message #1775588 is a reply to message #1775586] |
Wed, 01 November 2017 19:22   |
Eclipse User |
|
|
|
Hi
If you use a separate manually maintained *.ecore model then you set the option in the *.genmodel.
If you use auto-generated *.ecore models then you are at the mercy of the auto-generator.
I never use auto-generated models since I like to be in control rather than rely on idiomatic grammar cuteness to approximate the models I want.
Regards
Ed Willink
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05531 seconds