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   |
Eclipse User |
|
|
|
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-
|
|
|
Re: Using Acceleo investigating a model [message #783987 is a reply to message #783981] |
Thu, 26 January 2012 22:04   |
Eclipse User |
|
|
|
Hi
I think you just want to
Open your Ecore file in Sample Ecore Editor
select your root element
Invoke Create Dynamic Instance
Regards
Ed Willink
On 26/01/2012 21:49, Christian Dietrich wrote:
> 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-
|
|
|
|
Re: Using Acceleo investigating a model [message #784443 is a reply to message #784327] |
Fri, 27 January 2012 14:31   |
Eclipse User |
|
|
|
Yes
On 27/01/2012 11:13, Paolo Mising name wrote:
> Many thanks for your reply : I wish to thank you for your time.
>
> As Edward suggested, I implemented a Dinamic Instance of my meta-model
> (and called it Model.xmi) : is that I was looking for.
>
> I wish to know if it is possible to load Model.xmi in Acceleo and use
> it to produce the final transformation (the goal is translate a basic
> structure of my initial Domain Specific Language into a C# class).
>
> Regards.
> Paolo.
>
|
|
|
|
Re: Using Acceleo investigating a model [message #784499 is a reply to message #784489] |
Fri, 27 January 2012 16:14   |
Eclipse User |
|
|
|
It's called an input model.
On 27/01/2012 15:54, Paolo Mising name wrote:
> Hi Edward.
>
> Thank for your reply.
> Could you please tell me how to import that model in Acceleo? I have
> already written the template file to investigate the meta-model : what
> have I to do now?
>
> Regards.
> Paolo.
>
|
|
|
|
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.04473 seconds