0

I have defined my own language with xtext, and I am able to generate a textual model for said language. I am able to open this textual model (imageDSL) with the textual editor defined for this language and with the tree modeling editor (Image1):

enter image description here

With this textual model, I am able, through generators, to transform it to other models such as .xmi or xml so that it can be read by another application. From this application, I am able to generate an xml and transform it into an .xmi model of the classes that make up my language. However, when I try to open the .xmi with the editor of the defined language, it only shows me the tags (image2) that make up the .xmi file and does not show it as the textual language that I have defined previously.

enter image description here

I need from the .xmi model of my defined language to visualize the textual model from it. Could someone advise me how to go from an .xmi file to a file with the extension of the language that I have previously defined? If there is any automatic/semi-automatic way ...

Thanks in advance,

Cristian.

  • What about implementing a model-to-text transformation from XMI to your textual concrete syntax? You could then launch the transformation through a context menu action, maybe also opening the generated textual model into its editor. – Lorenzo Addazi Mar 15 '22 at 23:17
  • I think that you're looking for Serialization. Xtext parses your textual representation and creates the EMF model (AST). The opposite process is called serialization (converting from EMF model to textual representation). – Alejandro González Mar 23 '22 at 12:47

0 Answers0