Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Staged translation?
Staged translation? [message #1403467] Wed, 23 July 2014 22:03 Go to next message
Jed Liu is currently offline Jed LiuFriend
Messages: 2
Registered: July 2014
Junior Member
How well does the Xtext framework support staged translation?

More concretely, Xtend is translated to Java through the XtendJvmModelInferrer, which builds up bi-directional associations between the Xtend AST and the generated Java AST. What is the preferred way to perform further transformations on the generated Java AST, so that the associations with the original Xtend AST are maintained?

(A simple example of a transformation: insert getters and setters for all declared fields, and rewrite all field uses to use those getters and setters. While I could modify the Xtend translation, it would be more modular to stage my translation after the Xtend-to-Java translation.)

Thanks!
Re: Staged translation? [message #1403638 is a reply to message #1403467] Thu, 24 July 2014 18:04 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
do you mean something like xtend active annotations do?

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Staged translation? [message #1403646 is a reply to message #1403638] Thu, 24 July 2014 18:46 Go to previous message
Jed Liu is currently offline Jed LiuFriend
Messages: 2
Registered: July 2014
Junior Member
Sort of. I am looking to extend Xtend in a non-trivial way to produce a new language with its own compiler and IDE support. As such, I would like to have the transformation to always be applied to the entire AST without requiring annotations be present in the source that is being compiled.

Additionally, the transformation I would like to perform on the generated Java involves generating new Java types, which doesn't appear to be supported by active annotations.

[Updated on: Thu, 24 July 2014 19:27]

Report message to a moderator

Previous Topic:XtextDocument Resource empty after getContents()
Next Topic:[SOLVED] UnsupportedOperationException on enum
Goto Forum:
  


Current Time: Thu Apr 25 19:15:13 GMT 2024

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

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

Back to the top