|
|
|
|
Re: [Xpand] Advices not applied [message #512236 is a reply to message #512216] |
Thu, 04 February 2010 08:27  |
Eclipse User |
|
|
|
Sven Efftinge wrote:
> Esteban DUGUEPEROUX schrieb:
>> Hi Sven,
>>
>> Thanks it works fine now.
>>
>> But in one of my AROUND statement a call to a local DEFINE statement
>> which call a DEFINE statement in the main template doesn't works.
>> I must copy DEFINE statements that I would like to use in my second
>> template (where AROUND statements are defined) from the main template
>> to my second template.
>>
>> Is it clear?
>
> Not yet, sorry.
>
> Are you saying that your not able to call DEFINEs from within an AROUND?
>
> Sven
>
>
I can call local DEFINE statements to my template where I have defined
my AROUND statements but not the DEFINE statements from the main
template which is called for my code generation.
Code example :
Java code which launch my code generation :
Generator generator = new Generator( );
....
String aspectTemplate = "fr::inria::adam::calico::AspectTemplate";
generator.addAdvice(aspectTemplate);
....
generator.setExpand("fr::inria::adam::calico::common::JavaGeneration::main
FOR GenerationDefinition");
....
generator.invoke(ctx, monitor, issues);
my main template :
«DEFINE main FOR generation::GenerationDefinition»
«EXPAND componentImplementation FOR this»
«ENDDEFINE»
....
«DEFINE plop FOR generation::Plop»
....
«ENDDEFINE»
my aspect template :
«AROUND *componentImplementation FOR generation::GenerationDefinition»
«EXPAND plop FOR this.onePlop»
«ENDAROUND»
this doesn't works because I can't call "plop" DEFINE statement defined
in the main template and consequently I must recopy the "plop" DEFINE
statement in my aspect template.
Hum nothing better than an example.
|
|
|
Re: [Xpand] Advices not applied [message #512261 is a reply to message #512236] |
Thu, 04 February 2010 04:26  |
Eclipse User |
|
|
|
You'll have to call it by its qualified name.
<<EXPAND my::path::TemplateFile::plop FOR this.onePlop>>
Sven
Esteban DUGUEPEROUX schrieb:
> Sven Efftinge wrote:
>> Esteban DUGUEPEROUX schrieb:
>>> Hi Sven,
>>>
>>> Thanks it works fine now.
>>>
>>> But in one of my AROUND statement a call to a local DEFINE statement
>>> which call a DEFINE statement in the main template doesn't works.
>>> I must copy DEFINE statements that I would like to use in my second
>>> template (where AROUND statements are defined) from the main template
>>> to my second template.
>>>
>>> Is it clear?
>>
>> Not yet, sorry.
>>
>> Are you saying that your not able to call DEFINEs from within an AROUND?
>>
>> Sven
>>
>>
> I can call local DEFINE statements to my template where I have defined
> my AROUND statements but not the DEFINE statements from the main
> template which is called for my code generation.
>
> Code example :
>
> Java code which launch my code generation :
>
> Generator generator = new Generator( );
> ....
>
> String aspectTemplate = "fr::inria::adam::calico::AspectTemplate";
> generator.addAdvice(aspectTemplate);
> ....
> generator.setExpand("fr::inria::adam::calico::common::JavaGeneration::main
> FOR GenerationDefinition");
> ....
> generator.invoke(ctx, monitor, issues);
>
>
>
> my main template :
>
> «DEFINE main FOR generation::GenerationDefinition»
> «EXPAND componentImplementation FOR this»
> «ENDDEFINE»
> ....
> «DEFINE plop FOR generation::Plop»
> ....
> «ENDDEFINE»
>
> my aspect template :
>
> «AROUND *componentImplementation FOR generation::GenerationDefinition»
> «EXPAND plop FOR this.onePlop»
> «ENDAROUND»
>
>
> this doesn't works because I can't call "plop" DEFINE statement defined
> in the main template and consequently I must recopy the "plop" DEFINE
> statement in my aspect template.
>
> Hum nothing better than an example.
>
>
>
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
|
|
|
Re: [Xpand] Advices not applied [message #512263 is a reply to message #512261] |
Thu, 04 February 2010 04:26  |
Eclipse User |
|
|
|
Thanks it works and sorry for the stupid question because it was obvious
answer.
Best Regards.
Sven Efftinge wrote:
> You'll have to call it by its qualified name.
> <<EXPAND my::path::TemplateFile::plop FOR this.onePlop>>
>
> Sven
>
> Esteban DUGUEPEROUX schrieb:
>> Sven Efftinge wrote:
>>> Esteban DUGUEPEROUX schrieb:
>>>> Hi Sven,
>>>>
>>>> Thanks it works fine now.
>>>>
>>>> But in one of my AROUND statement a call to a local DEFINE statement
>>>> which call a DEFINE statement in the main template doesn't works.
>>>> I must copy DEFINE statements that I would like to use in my second
>>>> template (where AROUND statements are defined) from the main
>>>> template to my second template.
>>>>
>>>> Is it clear?
>>>
>>> Not yet, sorry.
>>>
>>> Are you saying that your not able to call DEFINEs from within an AROUND?
>>>
>>> Sven
>>>
>>>
>> I can call local DEFINE statements to my template where I have defined
>> my AROUND statements but not the DEFINE statements from the main
>> template which is called for my code generation.
>>
>> Code example :
>>
>> Java code which launch my code generation :
>>
>> Generator generator = new Generator( );
>> ....
>>
>> String aspectTemplate = "fr::inria::adam::calico::AspectTemplate";
>> generator.addAdvice(aspectTemplate);
>> ....
>> generator.setExpand("fr::inria::adam::calico::common::JavaGeneration::main
>> FOR GenerationDefinition");
>> ....
>> generator.invoke(ctx, monitor, issues);
>>
>>
>>
>> my main template :
>>
>> «DEFINE main FOR generation::GenerationDefinition»
>> «EXPAND componentImplementation FOR this»
>> «ENDDEFINE»
>> ....
>> «DEFINE plop FOR generation::Plop»
>> ....
>> «ENDDEFINE»
>>
>> my aspect template :
>>
>> «AROUND *componentImplementation FOR generation::GenerationDefinition»
>> «EXPAND plop FOR this.onePlop»
>> «ENDAROUND»
>>
>>
>> this doesn't works because I can't call "plop" DEFINE statement
>> defined in the main template and consequently I must recopy the "plop"
>> DEFINE statement in my aspect template.
>>
>> Hum nothing better than an example.
>>
>>
>>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.06668 seconds