Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » XMI to Xtext DSL
XMI to Xtext DSL [message #1807846] Tue, 11 June 2019 04:01 Go to next message
Marshall Charron is currently offline Marshall CharronFriend
Messages: 72
Registered: August 2018
Member
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 04:03]

Report message to a moderator

Re: XMI to Xtext DSL [message #1807850 is a reply to message #1807846] Tue, 11 June 2019 06:06 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14735
Registered: July 2009
Senior Member
hi, i am not aware of any non programmatic option for this

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com
Re: XMI to Xtext DSL [message #1807851 is a reply to message #1807850] Tue, 11 June 2019 06:10 Go to previous messageGo to next message
Marshall Charron is currently offline Marshall CharronFriend
Messages: 72
Registered: August 2018
Member
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 06:20 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14735
Registered: July 2009
Senior Member
do it programmatically. or dont create an xmi in the first place

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com
Re: XMI to Xtext DSL [message #1807857 is a reply to message #1807852] Tue, 11 June 2019 07:41 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7680
Registered: July 2009
Senior Member
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 08:10 Go to previous messageGo to next message
Tamas Miklossy is currently offline Tamas MiklossyFriend
Messages: 162
Registered: February 2016
Senior Member
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 20:47 Go to previous message
Alex Oli is currently offline Alex OliFriend
Messages: 19
Registered: May 2024
Junior Member
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 Dec 06 17:33:54 GMT 2024

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

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

Back to the top