1
votes

i have a question about Xtext. I know that Xtext creates a Ecore Modell for the DSL that is programmed in the .xtext File. Am i getting it right that xtext only creates EClass, EAttribute, EEnum and ERefernce in the Ecore Model? There is no way to create an Attribute of an Rule to have an EOperaption?

2
Well i wouldn't need it if i could get the referenced object with type and name .. of this object and the name of the reference. The latter i can get with ERerferenceObject.name... But the first is really a problem i can't collect the Object only the referenced EClass. This is example code from my dsl: setEntity=([Entity])... i can get the name of the ERerfence setEntity and i can get the EClass of the EReference and the EClass of the referenced EObject but nor the name or other information that is within the object. - user1104033

2 Answers

2
votes

Xtext allows to import an existing EPackage or infer a new one from a grammar definition. Since EOperations are not relevant to the concrete syntax, there is nothing that could be inferred for them. If you want to use EOperations, I suggest do switch to a manually maintained, imported package.

1
votes

Adding to Sebastian's answer: If you still want to use an inferred model you can use a model-postprocessor to adjust the model. This is easier if you only want to adjust only one or two things in the model like - adding additional operations.