Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » compile Xtext programs
compile Xtext programs [message #757317] Thu, 17 November 2011 16:39 Go to next message
Mokhtar Alshubei is currently offline Mokhtar AlshubeiFriend
Messages: 121
Registered: November 2011
Location: Germany
Senior Member
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 08:45 Go to previous messageGo to next message
Max Goltzsche is currently offline Max GoltzscheFriend
Messages: 40
Registered: November 2011
Member
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 18:29 Go to previous message
Max Goltzsche is currently offline Max GoltzscheFriend
Messages: 40
Registered: November 2011
Member
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 18:40]

Report message to a moderator

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


Current Time: Thu Apr 25 15:16:42 GMT 2024

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

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

Back to the top