Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » how to use xtext before M2M transformation
how to use xtext before M2M transformation [message #520568] Fri, 12 March 2010 20:24 Go to next message
farah Mising name is currently offline farah Mising nameFriend
Messages: 58
Registered: July 2009
Member
hello, i wanted to know if there is someone who knows how to work with xtext to make a transformation T2M before using the ATL ,
if you know ,please tell me what to do because i wrote an xtext grammar that i don't know what to do

thanks for your help
Re: how to use xtext before M2M transformation [message #520576 is a reply to message #520568] Fri, 12 March 2010 21:18 Go to previous messageGo to next message
Alex Mising name is currently offline Alex Mising nameFriend
Messages: 51
Registered: August 2009
Member
I would expect you don't have to do anything special. Xtext supplies EMF resource implementation, so you should be able to consume the textual representation of your models in any context where EMF model is expected. You can verify this by opening your textual representation (say .mydsl) file via the Sample Reflective Ecore editor.

Re: how to use xtext before M2M transformation [message #520837 is a reply to message #520576] Mon, 15 March 2010 14:39 Go to previous messageGo to next message
Horacio Hoyos is currently offline Horacio HoyosFriend
Messages: 242
Registered: October 2009
Location: Mexico
Senior Member

Hello,

Actualy is not that simple. To interpret your dsl files you neer to invoke the xtext MweReader and supply the generated dslStandaloneSetup class. Then you can save the interpretead model as an xmi.

<workflow>
	<property name='baseDir' value='platform:/resource/MyProject'/>
	<property name='dslFile' value='${baseDir}/dslfiles/file.mydsl'
	<property name="targetDir" value="${baseDir}/xmi"/>

	<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup" platformUri=".."/>

        <component class="org.eclipse.xtext.MweReader" uri="${dslFile}">
			<register class="dslStandaloneSetup"/>
			<outputSlot value="model"/>		
        </component>

       <component class="org.eclipse.emf.mwe.utils.Writer">
			<modelSlot value="model"/>
			<uri value="${targetDir}/dsl.xmi"/>
	</component>
</workflow>


When creating your xtext project check the "create generator project" option and look at it to see how your generated class is invoked.

My current issue is trynig to invoke both this (the workflow) and the subsequent ATL (in my case epsilon) transformations in a single ant file.


Horacio Hoyos Rodriguez
Kinori Tech
Need professional support for Epsilon, EMF?
Go to: https://kinori.tech
Re: how to use xtext before M2M transformation [message #521301 is a reply to message #520837] Wed, 17 March 2010 08:27 Go to previous messageGo to next message
farah Mising name is currently offline farah Mising nameFriend
Messages: 58
Registered: July 2009
Member
thank you very much for your help.
it works, but I can not open the xmi file with sample reflective ecore model editor

I received this warning
[WARNING]: the element in slot 'model' is already contained in a resource and will be taken out of that resource!(Element: -UNKNOWN-; Reported by: Writer: Writing model to src-gen/dsl.xmi)

look at this link http://www.eclipse.org/forums/index.php?t=msg&th=164435& amp; amp;start=0&

Thank you very very much Smile
Farah

[Updated on: Wed, 17 March 2010 12:22]

Report message to a moderator

Re: how to use xtext before M2M transformation [message #521637 is a reply to message #521301] Thu, 18 March 2010 11:09 Go to previous message
farah Mising name is currently offline farah Mising nameFriend
Messages: 58
Registered: July 2009
Member
Hi,
we must add EmfRegistryMetaModel !?

Farah
Previous Topic:[ATL] Set boolean flag if object is referenced
Next Topic:[QVTO] Blackbox library inclusion problem
Goto Forum:
  


Current Time: Wed Apr 24 22:32:55 GMT 2024

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

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

Back to the top