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
TheEMF User is currently offline TheEMF UserFriend
Messages: 71
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: 13163
Registered: July 2009
Senior Member
hi, i am not aware of any non programmatic option for this

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
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
TheEMF User is currently offline TheEMF UserFriend
Messages: 71
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: 13163
Registered: July 2009
Senior Member
do it programmatically. or dont create an xmi in the first place

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
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: 6481
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: 66
Registered: February 2016
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: Sun Oct 20 19:37:37 GMT 2019

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

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

Back to the top