Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Xtext - Generating files
Xtext - Generating files [message #1019247] Fri, 15 March 2013 10:12 Go to next message
rohit ahuja is currently offline rohit ahujaFriend
Messages: 27
Registered: February 2013
Junior Member
I created a ecore Digaram to make it act as an Data Store.
I also created a Xtext DSL to parse my grammar, and mapped the parsed grammar to the Ecore using the getter methods of the DSL and setting the corresponding setter methods in the Ecore. Thus the ecore now contains my parsed data.

Now, i want to generate some other files, which use the data from the ecore data store. What is the best possible way to do it?

I have seen lot of places Xtend is suggested, but that is mostly directly working on the Xtext to generate other files, i do not see any cases where the generation of new files works on Ecore Data store. Is it possiblre o make it work that way?


Can some one please suggest a good solution? Please suggest some good documentation links as well.


Re: Xtext - Generating files [message #1020581 is a reply to message #1019247] Mon, 18 March 2013 13:52 Go to previous message
Jan Koehnlein is currently offline Jan KoehnleinFriend
Messages: 760
Registered: July 2009
Location: Hamburg
Senior Member
Once an Ecore resource is loaded, you can access its elements as POJOs.
Search for Ecore tutorials in the web.
Building a code generator with Xtend boils down to read in the model,
traverse its contents and generate some output text on the way. Xtend's
template expressions have proven to be very valuable.

Am 15.03.13 11:12, schrieb rohit ahuja:
> I created a ecore Digaram to make it act as an Data Store.
> I also created a Xtext DSL to parse my grammar, and mapped the parsed
> grammar to the Ecore using the getter methods of the DSL and setting the
> corresponding setter methods in the Ecore. Thus the ecore now contains
> my parsed data.
>
> Now, i want to generate some other files, which use the data from the
> ecore data store. What is the best possible way to do it?
>
> I have seen lot of places Xtend is suggested, but that is mostly
> directly working on the Xtext to generate other files, i do not see any
> cases where the generation of new files works on Ecore Data store. Is it
> possiblre o make it work that way?
>
>
> Can some one please suggest a good solution? Please suggest some good
> documentation links as well.
>
>
>


--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com


---
Get professional support from the Xtext committers at www.typefox.io
Previous Topic:Errors in Domain project from 2.4 latest ?
Next Topic:[Xtend2]
Goto Forum:
  


Current Time: Fri Aug 14 05:24:57 GMT 2020

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

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

Back to the top