Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » XText doesn't generate MyDSLPackage$Literals any longer
XText doesn't generate MyDSLPackage$Literals any longer [message #1067026] Fri, 05 July 2013 13:24 Go to next message
Sascha Gstir is currently offline Sascha GstirFriend
Messages: 12
Registered: May 2013
Junior Member
Hey guys,

I have defined a grammatic for my own DSL and still defined
some validation rules. In my validation rules I use the error
function like this:

 error('errormessage', MyDSLPackage$Literals::ANY_STRUCTURAL_FEATURE)


Now I wanted to add some more features to my DSL and so I have
defined more rules in my .xtext file. But now XText doesn't
generate the MyDSLPackage$Literals any longer.

If remove the added rules and generate again the XText artefacts
then the MyDSLPackage$Literals is generated again.

Why is that? Is der a maximum limit for literals/rules?
And how can I use the error function when there is no
MyDSLPackage$Literals file?

Please help me!

greets
Re: XText doesn't generate MyDSLPackage$Literals any longer [message #1067028 is a reply to message #1067026] Fri, 05 July 2013 13:30 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14716
Registered: July 2009
Senior Member
Hi do you get any error in the log. Please note: depending on the
grammar the feature may be shift up to a parent -
So bit would be

PARENT__FEATURE and not CHILD__ FEATURE

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: XText doesn't generate MyDSLPackage$Literals any longer [message #1067029 is a reply to message #1067026] Fri, 05 July 2013 13:34 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14716
Registered: July 2009
Senior Member
And yes I think there is a limit for the liberals to be generated.

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: XText doesn't generate MyDSLPackage$Literals any longer [message #1067031 is a reply to message #1067026] Fri, 05 July 2013 13:48 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14716
Registered: July 2009
Senior Member
Alternatively you can use
Mydslpackage.eInstance.getxxx_yyy()

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: XText doesn't generate MyDSLPackage$Literals any longer [message #1067034 is a reply to message #1067029] Fri, 05 July 2013 14:22 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33217
Registered: July 2009
Senior Member
Christian,

Yes. There is a GenPackage property "Literals Interface" which controls
this. When the *.genmodel is created, that property is set to false for
very large models; we must "guess/estimate" when a model will be so
large that the generated Literals interface will exceed the 64K byte
code limit of Java. So if there is a *.genmodel that can be edited, one
could try to set that property to true...


On 05/07/2013 3:34 PM, Christian Dietrich wrote:
> And yes I think there is a limit for the liberals to be generated.
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: XText doesn't generate MyDSLPackage$Literals any longer [message #1067257 is a reply to message #1067028] Mon, 08 July 2013 07:01 Go to previous messageGo to next message
Sascha Gstir is currently offline Sascha GstirFriend
Messages: 12
Registered: May 2013
Junior Member
Christian Dietrich wrote on Fri, 05 July 2013 09:30
Hi do you get any error in the log. Please note: depending on the
grammar the feature may be shift up to a parent -
So bit would be

PARENT__FEATURE and not CHILD__ FEATURE

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


No, I don't get any errors while generating the XText artefacts. I also did not change any rules so the features can not change from child to parent.
Re: XText doesn't generate MyDSLPackage$Literals any longer [message #1067259 is a reply to message #1067034] Mon, 08 July 2013 07:05 Go to previous messageGo to next message
Sascha Gstir is currently offline Sascha GstirFriend
Messages: 12
Registered: May 2013
Junior Member
Ed Merks wrote on Fri, 05 July 2013 10:22
Christian,

Yes. There is a GenPackage property "Literals Interface" which controls
this. When the *.genmodel is created, that property is set to false for
very large models; we must "guess/estimate" when a model will be so
large that the generated Literals interface will exceed the 64K byte
code limit of Java. So if there is a *.genmodel that can be edited, one
could try to set that property to true...


On 05/07/2013 3:34 PM, Christian Dietrich wrote:
> And yes I think there is a limit for the liberals to be generated.
>


I found this property in the genmodel file and changed it to true, but it always got overwritten when generating the XText artefacts.
Re: XText doesn't generate MyDSLPackage$Literals any longer [message #1067260 is a reply to message #1067031] Mon, 08 July 2013 07:09 Go to previous message
Sascha Gstir is currently offline Sascha GstirFriend
Messages: 12
Registered: May 2013
Junior Member
Christian Dietrich wrote on Fri, 05 July 2013 09:48
Alternatively you can use
Mydslpackage.eInstance.getxxx_yyy()

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de



Hey Christian,

thank you very much. I was able to solve my problem now with your advice.
I write the validation rules in XTend so my "error function calls" look like this:
error('error message', MyDSLPackage::eINSTANCE.rule_feature)
Previous Topic:quick fix in xtext
Next Topic:NamesAreUniqueValidator & JvmModelInferrer
Goto Forum:
  


Current Time: Mon Sep 23 23:53:59 GMT 2024

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

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

Back to the top