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: 14661
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
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: 14661
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
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: 7655
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 message
Tamas Miklossy is currently offline Tamas MiklossyFriend
Messages: 157
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.
Previous Topic:Xtext domainmodel error
Next Topic:After Xtext 2.18.0 migration, SWT Bot is not installing
Goto Forum:
  


Current Time: Thu Mar 28 15:37:48 GMT 2024

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

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

Back to the top