|
|
Re: How to implement generalization in XText ? [message #1722576 is a reply to message #1722460] |
Fri, 05 February 2016 21:04   |
Eclipse User |
|
|
|
Thanks a lot Christian for your quick reply and help.
Do you know if we have an attribute (let's say name) in Concept, and Message also inherits this "name" attribute form Concept, then from what I can see we need to declare name in the Message and not in Concept. Because concept here is just a transient element, right ? I tried having name for both Concept and for Message. In the generated ecore file it adds name attribute for both elements. However, since it is a inheritance, only Concept should have it and inherited Message can have name attribute by inheritance... What do you suggest ?
I want to end yup with generating an ecore file like below:
Concept
-name: EString
Message->Concept
-a1
-a2
So, Message still has name attribute by the definition of inheritance. Not sure, how to do in XText.
Thanks,
Bests,
Parsa
|
|
|
Re: How to implement generalization in XText ? [message #1722588 is a reply to message #1722576] |
Sat, 06 February 2016 04:27  |
Eclipse User |
|
|
|
Hi have a look in the docs. It describes how ecore is inferred. At a
certain point switching to a handwritten meta model might be better
Having the name at the parent level makes only sense if you have 2 child's.
If you have
Parent:A|B
And
A:name=ID
And
B:name=ID
Then
Parent will get the name from the inferrer
|
|
|
Powered by
FUDForum. Page generated in 0.06462 seconds