|
Re: Porting Xpand to Xtend2 [message #878968 is a reply to message #878948] |
Wed, 30 May 2012 09:35 |
|
Hi,
there is no porting guide. from personal porting experience i can say:
- start with a new file foreach xpand file
- create a dispatch method for every define statements.
<<DEFINE xxx FOR YYY>>
...
<<ENDDEFINE>>
def dispatch xxx(YYY yyy) '''
...
'''
- migration might be tricky at some points but mostly it should be straigt forward
(depending on the metamodelcontributor you use)
Feels free to ask any questions.
~Christian
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
Re: Porting Xpand to Xtend2 [message #879707 is a reply to message #878948] |
Thu, 31 May 2012 17:20 |
|
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, EMF, Eclipse IDE?
Go to: http://devhub.karakun.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04347 seconds