Skip to main content



      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 15:24 Go to next message
Eclipse UserFriend
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 16:18 Go to previous messageGo to next message
Eclipse UserFriend
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 10:39 Go to previous messageGo to next message
Eclipse UserFriend
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.
Re: how to use xtext before M2M transformation [message #521301 is a reply to message #520837] Wed, 17 March 2010 04:27 Go to previous messageGo to next message
Eclipse UserFriend
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 08:22] by Moderator

Re: how to use xtext before M2M transformation [message #521637 is a reply to message #521301] Thu, 18 March 2010 07:09 Go to previous message
Eclipse UserFriend
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 Jul 23 09:56:07 EDT 2025

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

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

Back to the top