Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Ant/Xpand]problem with mwe script that uses xpt script
[Ant/Xpand]problem with mwe script that uses xpt script [message #885725] Wed, 13 June 2012 13:38 Go to next message
Lucian Apetre is currently offline Lucian ApetreFriend
Messages: 8
Registered: May 2011
Junior Member
I have the error:

SEVERE: [ERROR]: property 'expand' has wrong syntax : mismatched input 'for' expecting TEXT on line 1(Element: -UNKNOWN-; Reported by: Generator(generator): generating 'templates::createDialogGrammar::Root for model' => D:\_WORK\SDT_output/Grammar//)

I want to create a script that will generate a file and do something with it.
For start I have created a mwe file that contains:
<workflow>
.....
.....
<component id="generator" class="org.eclipse.xpand2.Generator">
<metaModel id="mm" class="org.eclipse.xtend.typesystem.emf.EmfMetaModel">
<metaModelPackage value="grammarmodel.GrammarmodelPackage"/>
</metaModel>
<expand value="templates::createDialogGrammar::Root for model"/>
<outlet path="${generatedPath}/">
<fileEncoding value="ISO-8859-1"/>
</outlet>
</component>
....
</workflow>

I also have the createDialogGrammar.xpt that contains a simple define:
«IMPORT grammarmodel»

«DEFINE Root FOR String»
«FILE "TEST.h"-»
//test
//test2
«ENDFILE»
«ENDDEFINE»

Mainly I want to execute this xpt script.

Can anyone have a clue about what's wrong in executing this expand command with the mwe script?
Thank you in advance
Re: [Ant/Xpand]problem with mwe script that uses xpt script [message #885911 is a reply to message #885725] Wed, 13 June 2012 21:16 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Hi,

the syntax is <expand value="templates::Root::Root FOR model"/>

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: [Ant/Xpand]problem with mwe script that uses xpt script [message #886130 is a reply to message #885911] Thu, 14 June 2012 09:51 Go to previous messageGo to next message
Lucian Apetre is currently offline Lucian ApetreFriend
Messages: 8
Registered: May 2011
Junior Member
Hi,

Thank you for the reply.
I wrote in like this:

<component id="generator" class="org.eclipse.xpand2.Generator">
<metaModel id="mm" class="org.eclipse.xtend.typesystem.emf.EmfMetaModel">
<metaModelPackage value="ContiSpeechDlg.ContiSpeechDlgPackage"/>
</metaModel>
<expand value="templates::createDialogGrammar::Root FOR model"/>
<outlet path="${basedir}../generated/public/">
<fileEncoding value="ISO-8859-1"/>
</outlet>
</component>

and it worked. I'm doing it by trial and error, I don't have a nice documentation on this.
If someone can share some documents I'll be very thankefull.
Re: [Ant/Xpand]problem with mwe script that uses xpt script [message #886150 is a reply to message #886130] Thu, 14 June 2012 10:31 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Hi this should be contained in the Xpand documentation

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: [Ant/Xpand]problem with mwe script that uses xpt script [message #888679 is a reply to message #885725] Mon, 18 June 2012 13:19 Go to previous messageGo to next message
Lucian Apetre is currently offline Lucian ApetreFriend
Messages: 8
Registered: May 2011
Junior Member
It seems that the problem is related to the metamodel loaded.
I was trying to load grammarmodel.GrammarmodelPackage metamodel but somehow the metaModelPackage value(path) is not correct.
I replaced the metamodel value with ContiSpeechDlg.ContiSpeechDlgPackage and it worked.
Note: I have 2 .ecore files that I wanted to use(ContiSpeechDlg.ContiSpeechDlgPackage and grammarmodel.GrammarmodelPackage), only with ContiSpeechDlg.ContiSpeechDlgPackage it worked.

The <expand> tag was correct, it pointed to <package_name>::<xpt_name>::<define_name_from_xpt>.

I still have some troubles finding a good and explanatory documentation for those mwe scripts(Ant?!), what tags should I use and when and the correct syntax for it.
Thank you for you time spend in trying to figure it out.
Re: [Ant/Xpand]problem with mwe script that uses xpt script [message #889869 is a reply to message #888679] Wed, 20 June 2012 04:57 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Hi,

it is just a simple xml syntax for wiring up java beans.
it should be explained in Modeling Workflow Engine Reference
of eclipse help

=> have a look at java class, look for setXXX or addYYY methods

=>

<component class="XXX">
<XXX />
<YYY />
<YYY />
</component>

or (if xxx is primitive)

<component class="XXX" xxx="...">
<YYY />
<YYY />
</component>


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:[Acceleo] Performance Profiling
Next Topic:[Acceleo] Extending template with dynamic overriding and class inheritance
Goto Forum:
  


Current Time: Thu Mar 28 17:56:15 GMT 2024

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

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

Back to the top