| Porting Xpand to Xtend2 [message #878948] |
Wed, 30 May 2012 04:55  |
Andy Gotz Messages: 32 Registered: July 2010 |
Member |
|
|
Hi,
I am an absolute newbie porting a DSL code generator project from Xpand to Xtend2. I have downloaded the Xtext distribution from itemis based on Eclipse 3.7.1. I see that the Xpand templates having an .xpt extension are not recognised by Xtext. How should I best go about porting these templates to Xtend2? Should I just rename them .xtend and then fix the errors eventually using the Xtend language features instead of the Xpand ones? Is there a porting guide I could read?
Thanks for any help you can give an absolute newbie ...
Andy
|
|
|
|
| Re: Porting Xpand to Xtend2 [message #879707 is a reply to message #878948] |
Thu, 31 May 2012 13:20   |
Karsten Thoms Messages: 333 Registered: July 2009 Location: Dortmund |
Senior Member |

|
|
Hi Andy,
although Xpand and Xtend2 are rather close related, porting is a manual task. Attached PERL script does some of those conversions that can be decided half-automatically. However, the resulting file won't be fully compilable. The script is just meant to "preprocess" Xpand templates and convert them to something more closely to Xtend2, like converting DEFINE to def functions, removing "-" signs, converting FOR loops. It is required to know Xtend to fix the remaining.
Porting templates is just one side, you'll need also an according workflow. If using Xtext as models, the infrastructure is already there and a skeleton of a generator workflow is available. If using non-Xtext models, you can either code a workflow component yourself and file access, or reuse Xtext's infrastructure. I tend to use the latter, but it requires some setup of Guice.
Best wishes,
~Karsten
Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
|
|
|
|
| Re: Porting Xpand to Xtend2 [message #880540 is a reply to message #880534] |
Sat, 02 June 2012 04:23   |
Christian Dietrich Messages: 4555 Registered: July 2009 |
Senior Member |
|
|
Hi,
i guess you should do some Xtend tutorial first.
this would tell you that Xtend in something like a better java
=> you create classes.
=> you import the FQN names of you Java!!!!! Metaclasses.
=> you use @Inject extension ExtensionClassName for extensions.
btw i think top down porting is a bad idea.
~Christian
[Updated on: Sat, 02 June 2012 04:25] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.01973 seconds