Using Acceleo investigating a model [message #783758] |
Thu, 26 January 2012 11:57 |
Paolo Missing name Messages: 9 Registered: January 2012 |
Junior Member |
|
|
My name is Paolo and I am a new Acceleo user.
I am stuck on a particolar stage of my project and I wish to know if you could, please, give some information or a tutorial where to find this info.
Using XTEXT Eclipse Tool, I wrote the grammar to implement a Dsl language, and as result I had the corresponding ".ecore" meta-model.
I imported this ".ecore" meta-model in an Acceleo project , and wrote the template to investigate this meta-model, just to reach my final target (implement a C# language transformation of my initial Dsl language).
Doing this process I had no problems.
At this point my problems are the following :
1) in Acceleo, how is it possible to implement a "model" of this meta-model ?
2) in Acceleo, how is possible to write a template that investigates (I mean, that collect information) from a model implemented in point 1 and use it for my final target?
I wish to thank you in advance for your help.
Best regards.
Paolo.
|
|
|
|
|
Re: Using Acceleo investigating a model [message #783981 is a reply to message #783978] |
Thu, 26 January 2012 21:49 |
|
Hi,
this is clear, but i dont know how to do this in a generic way (so that it will work with all ecores of the world) how do you want to tell acceleo to create a Class Person and an Attribute Name.
this would be rather static and thus imho nonsence.
btw acceleo is a Model 2 Text tool, maybe you are looking for a Model2Model too.
but as i said: without knowing your rules how you want to decide what instances to create this is hard to tell.
so let us say you have a EClass Model that has a list of EClasses Entity that have an EAttribut name.
what so you want to do-
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com
|
|
|
|
|
|
|
|
|
Re: Using Acceleo investigating a model [message #787164 is a reply to message #784519] |
Tue, 31 January 2012 08:25 |
|
Hi Paolo,
Loading a dynamic instance as input of an Acceleo generation is the same as loading a "regular" model. The only thing to look at if I am not mistaken is to make sure your package is properly registered (see the "registerPackage" method of the generated launcher).
However, please make sure that using a "dynamic instance" is indeed what you need. If you are trying to create generators that should be used by others, you probably need to generate your model code and use a real instance of this model as input of the generation. Make sure you also take a look at the Getting Started guide if you have not done it yet.
Laurent Goubet
Obeo
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04219 seconds