Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Extraction to multiple files
Extraction to multiple files [message #555105] Wed, 25 August 2010 13:21 Go to next message
adrian  is currently offline adrian Friend
Messages: 93
Registered: August 2009
Member
Hi all,
My grammar is like that :
Programmes:
prs=Programme
Programme : ........

so each Programmes has one Programme.
I have as input a model ecore defined as :
Programmes :
----Programme1: ....
----Programme2:...
....................................
----ProgrammeN:.........

How I can change the extraction workflow to obtain form this model N files each file contains a 'Programme'?
Re: Extraction to multiple files [message #555114 is a reply to message #555105] Wed, 25 August 2010 13:37 Go to previous messageGo to next message
Alexander Nittka is currently offline Alexander NittkaFriend
Messages: 1193
Registered: July 2009
Senior Member
Hi,

I don't quite understand the scenario. If each Programmes can only have
one program (as the grammar suggessts), how can the input model have
several.

Do you mean the generator project's workflow when you say "extraction"
workflow?

If you use MWE2 you can load elements of a particular type into the
model slot. If you choose Programme, you could have a main template
defined for Programme (creating a file) and in the workflow file you
simply invoke the template "...FOREACH modelslot".
(This is basically what the greetings example does).
Note also that for this to work (out of the box), Programme has to have
a name attribute, so that it gets a qualified name by default.

If this does not help, please describe more clearly what you try to achieve.


Alex


Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext@itemis.de
Re: Extraction to multiple files [message #555120 is a reply to message #555105] Wed, 25 August 2010 13:51 Go to previous messageGo to next message
adrian  is currently offline adrian Friend
Messages: 93
Registered: August 2009
Member
Hi Alexander,
The point is that I have a model ecore which contains several programmes and I want to extract text from this model.THe input model is not conforme to the grammar so I think it must be divided into several ecore models each one contains a programme.
I want to set a mecanism that enables me to have as output of the extraction of the input model as many text files as the number of the programs in the input model.
Re: Extraction to multiple files [message #555133 is a reply to message #555120] Wed, 25 August 2010 14:24 Go to previous message
Alexander Nittka is currently offline Alexander NittkaFriend
Messages: 1193
Registered: July 2009
Senior Member
Hi,

this sounds like a model to model transformation to me. From the
non-conform ecore-model to several models that each correspond to the
meta model defined by your grammar.

Alex


Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext@itemis.de
Previous Topic:Re: Validation produces Duplicate EModelElement without reason
Next Topic:The code of method ... is exceeding the 65535 bytes limit
Goto Forum:
  


Current Time: Thu Apr 25 10:46:28 GMT 2024

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

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

Back to the top