Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Xtend as a End User Template?
Xtend as a End User Template? [message #1815448] Wed, 02 October 2019 19:35 Go to next message
Eclipse UserFriend
I done some Xtext work for a handful of years now and so I have used Xtend as a language as a developer.

In the past in one of my EMF RCP apps, we let the users write their own FreeMarker templates. That was a way for us to let the end users extend the capability of our app and not really require them to know anything about the development environment or require them to install anything other than the deployed RCP. They wrote a FreeMarker template, we processed their selected templates against the EMF model and that was that.

I haven't really seen or heard of Xtend being used like this. Is it possible or are there any examples of projects where end users write their own Xtend templates to generate output from the compiled model? Even if they have to manually invoke a separate generator from the Xtext Builder's usual build method?
Re: Xtend as a End User Template? [message #1815476 is a reply to message #1815448] Thu, 03 October 2019 05:50 Go to previous message
Eclipse UserFriend
One main difference is that Freemarker templates are interpreted while Xtend is compiled. So when a user changes a template it requires an additional build step to compile the templates for execution.

Templates are used for code generation, and Xtend is a wonderful language for template based code generation. So yes, this is possible. We have done this in a couple of customer projects. Code from these can't be shared, though.

You may get some ideas to write small dedicated code generators with Xtend from these slides, the session was also recorded and is on Youtube:
https://de.slideshare.net/kthoms/recipes-to-build-code-generators-for-nonxtext-models-with-xtend
Previous Topic:how to customize the XtextBuilder
Next Topic:How to show different Syntax in editor than serialized?
Goto Forum:
  


Current Time: Mon Mar 24 21:27:09 EDT 2025

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

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

Back to the top