Completeness of the .ecore generated by Xtext [message #1806901] |
Fri, 17 May 2019 10:15 |
Martin Jürgens Messages: 3 Registered: May 2019 |
Junior Member |
|
|
Hi,
I want to generate instances of an Xtext model. For a start, I am doing it for the Domainmodel, where I take the generated .ecore model and apply model instance generation methods onto it.
What I have noticed is that the generated .ecore does not contain all the properties that the Xtext grammar seems to have.
For example:
- Type is delegated with (|) to DataType or Entity. In my opinion, the Type class / Type part of the generated .ecore file should therefore be abstract (abstract="true")
- For the Feature - Type relation, lowerBound="1" upperBound="1" should be set, as according to the grammar, a Feature must have a Type
Is there a specific reason why the .ecore file is not shaped like this or a way to have it generated in a way such that it contains more information?
The reason why I am asking is this: The model instances that I generate have a graph structure. Based on this graph structure I build up an EObject that I perspectivally want to use for running (testing) generators on. In the case of Type not being abstract, my translator adds Type to the EObject and latest at the step of serialization I am running into a IllegalStateException. For a start, it is okay to manually adjust the .ecore file, but it would be nice to have a more general approach which is blocked by this. So if anyone has any thoughts onto it, feel free to share! :)
Thanks,
Martin
|
|
|
|
Powered by
FUDForum. Page generated in 0.03510 seconds