Skip to main content



      Home
Home » Modeling » TMF (Xtext) » XMI to Xtext DSL
XMI to Xtext DSL [message #1807846] Tue, 11 June 2019 00:01 Go to next message
Eclipse UserFriend
Hi,

I have an XMI file derived from a DSL metamodel.

I would like to convert it back to the DSL, i.e myfile.mydsl.

Is this possible using Eclipse, without doing this programmatically ?

[Updated on: Tue, 11 June 2019 00:03] by Moderator

Re: XMI to Xtext DSL [message #1807850 is a reply to message #1807846] Tue, 11 June 2019 02:06 Go to previous messageGo to next message
Eclipse UserFriend
hi, i am not aware of any non programmatic option for this
Re: XMI to Xtext DSL [message #1807851 is a reply to message #1807850] Tue, 11 June 2019 02:10 Go to previous messageGo to next message
Eclipse UserFriend
I mean how can I transform a myfile.xmi to myfile.mydsl in Eclipse ?

Thanks
Re: XMI to Xtext DSL [message #1807852 is a reply to message #1807851] Tue, 11 June 2019 02:20 Go to previous messageGo to next message
Eclipse UserFriend
do it programmatically. or dont create an xmi in the first place
Re: XMI to Xtext DSL [message #1807857 is a reply to message #1807852] Tue, 11 June 2019 03:41 Go to previous messageGo to next message
Eclipse UserFriend
Hi

You haven't told us what the relationship is between the DSL and the XMI.

If you have the 'trivial' relationship whereby Xtext treats the DSL source text and its underlying parsed EMF model as equivalent, then you should be able to open the XMI with your DSL editor see the serialized text and copy/save it as text.

If you have a non-trivial relationship, then the programmer of your forward conversion from DSL to XMI may also program the reverse conversion from XMI to DSL so that you can open in your DSL editor as above. (This works for the OCL, QVTc, QVTi, QVTr editors.)

Regards

Ed Willink
Re: XMI to Xtext DSL [message #1807868 is a reply to message #1807857] Tue, 11 June 2019 04:10 Go to previous messageGo to next message
Eclipse UserFriend
You may get some inspiration from the following blog post: https://blogs.itemis.com/en/combining-emf-models-with-xtext-dsls

It contains (among others) an example implementation for:
Quote:
An additional feature could be to add Xtext serialization support to EMF models; when the user edits an EMF element and saves the *.emfstatemachine file, we want that the corresponding *.statemachine Xtext DSL file is automatically generated.
Re: XMI to Xtext DSL [message #1866798 is a reply to message #1807868] Thu, 06 June 2024 16:47 Go to previous message
Eclipse UserFriend
I ended up implementing programmatically in my plugin.
Thank you all for your time
Previous Topic:Embedding Comments in Custom DSL Files
Next Topic:Embedding Comments in Custom DSL Files
Goto Forum:
  


Current Time: Fri Jun 20 01:29:30 EDT 2025

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

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

Back to the top