Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » generate code as is from user input
generate code as is from user input [message #1269414] Tue, 11 March 2014 21:06 Go to next message
jack feitelsonn is currently offline jack feitelsonnFriend
Messages: 4
Registered: March 2014
Junior Member
Hi,
We have written XText grammar that parses some proprietary DSL.
Now we want "compile" this into our proprietray format XXX.

We have to write just a bit of Xtend because we have kept the grammar close to the original syntax of the DSL.

So we don't want to iterate the Tree of the objects we just want to copy LARGE parts of the code AS IS.

How can I copy code AS IS?

Thanks,
Jack
Re: generate code as is from user input [message #1270028 is a reply to message #1269414] Wed, 12 March 2014 12:22 Go to previous messageGo to next message
Hallvard Traetteberg is currently offline Hallvard TraettebergFriend
Messages: 673
Registered: July 2009
Location: Trondheim, Norway
Senior Member
Hi,

I use NodeModelUtils.getTokenText(NodeModelUtils.getNode(eObject)) to
get the original DSL source code. E.g. I use it for some simple XHTML
that I just inject into a generated HTML file.

Hallvard

On 12.03.14 13:17, jack feitelsonn wrote:
> Hi,
> We have written XText grammar that parses some proprietary DSL.
> Now we want "compile" this into our proprietray format XXX.
>
> We have to write just a bit of Xtend because we have kept the grammar
> close to the original syntax of the DSL.
>
> So we don't want to iterate the Tree of the objects we just want to copy
> LARGE parts of the code AS IS.
>
> How can I copy code AS IS?
>
> Thanks,
> Jack
Re: generate code as is from user input [message #1272340 is a reply to message #1269414] Mon, 17 March 2014 17:37 Go to previous message
jack feitelsonn is currently offline jack feitelsonnFriend
Messages: 4
Registered: March 2014
Junior Member
Thank you, it works!
Previous Topic:Programmatically access elements imported from another Ecore model
Next Topic:As a result, alternative(s) 2 were disabled for that input__ldscript
Goto Forum:
  


Current Time: Fri Apr 26 08:21:50 GMT 2024

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

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

Back to the top