Porting Xpand to Xtend2 [message #878948] |
Wed, 30 May 2012 04:55  |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06361 seconds