Skip to main content



      Home
Home » Modeling » TMF (Xtext) » compile Xtext programs
compile Xtext programs [message #757317] Thu, 17 November 2011 11:39 Go to next message
Eclipse UserFriend
Hello all,

is there a way to transform my DSL programs to executable format?! i got an example of XPand that transform from that DSL to java beans but still far down the execution point.

regards
Re: compile Xtext programs [message #757393 is a reply to message #757317] Fri, 18 November 2011 03:45 Go to previous messageGo to next message
Eclipse UserFriend
Have a look at Xtend 2 and Xbase. Xtend 2 is the successor of Xpand.
Finally, you can always generate any kind of code from a ecore model described with your language with such generator language.

regards,
Max
Re: compile Xtext programs [message #757523 is a reply to message #757393] Fri, 18 November 2011 13:29 Go to previous message
Eclipse UserFriend
Xbase comes with Xtext 2 as far as I know. It gives you the possibility to use all features of a highlevel programming language in your dsl.
Now, you can easily infer a JvmType of a instantiated grammar element of your language. There's also a module that allows you to generate java code from the infered jvm model of your grammar model or parts of it.
In the best case you only create your grammar which may extend from xbase and use xbase's grammar rules, implement an IJvmModelInferrer for your own specific grammar rules (there are methods like clazz=yourRule.toClass(); clazz.members += yourRule.toField(); clazz.members += yourRule.toMethod()) and use the JvmModelGenerator to generate executable java code from an inferred jvm model of your dsl as Christian Dietrich says in http://www.eclipse.org/forums/index.php/mv/msg/262355/757497/#msg_757497. I have not yet tried the last part with 2.1 but as far I've evaluated Xtext it works well.

[Updated on: Fri, 18 November 2011 13:40] by Moderator

Previous Topic:GeneratorFragment refused to work
Next Topic:how to trigger generation of files in folder xtend-gen
Goto Forum:
  


Current Time: Wed Jul 23 12:38:48 EDT 2025

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

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

Back to the top