[Xpand] LET statement [message #506220] |
Wed, 06 January 2010 09:52  |
Eclipse User |
|
|
|
Hi,
I have a 'component' metamodel. In this metamodel a component have
ports, and each port is typed by a interface.
From a corresponding model I want to generate all referenced interfaces
by component's ports.
I want also to use PROTECT BLOCK feature with the ID generation, but I
must not generate several times the same PROTECT BLOCK.
Then I must know I a current interface in my template generation has
been already generated. To do that I think about a global variable which
keep all generated interface like this :
«LET Set[String] AS generatedInterfaces»
«»
«ENDLET»
and add generated interface in a EXPAND/FILE statement like this :
«generatedInterfaces.put(interface)»
Unfortunaly this doesn't works.
Xpand documentation only describe LET statement with the String
primitive type.
Any help would be welcome.
For more details see
http://gforge.inria.fr/plugins/scmsvn/viewcvs.php/trunk/v1/p lugins/fr.inria.adam.calico.models.generation.xpand.fractalT emplate/models/?root=calico
Launcher.java permits to launch the xpand template without MWE.
Best Regards.
|
|
|
|
|
|
Re: [Xpand] LET statement [message #506440 is a reply to message #506366] |
Thu, 07 January 2010 09:36  |
Eclipse User |
|
|
|
Hello Esteban,
you iterate too often over the subcomponents:
in main you call
«EXPAND componentImplementation FOREACH this.subComponents»
«EXPAND componentImplementation FOR this»
and in componentImplementation you also call
«EXPAND componentImplementation FOREACH this.subComponents»
So you override already generated files and the protected region id collector emits these warn statements as it is served with already collected ids.
Cheers,
Joerg
|
|
|
Re: [Xpand] LET statement [message #506472 is a reply to message #506440] |
Thu, 07 January 2010 06:18  |
Eclipse User |
|
|
|
Yes you are right,
a stupid mistake on my part.
Thanks Joerg.
Joerg Reichert wrote:
> Hello Esteban,
>
> you iterate too often over the subcomponents:
>
> in main you call
>
>
> «EXPAND componentImplementation FOREACH this.subComponents»
> «EXPAND componentImplementation FOR this»
>
> and in componentImplementation you also call
>
>
> «EXPAND componentImplementation FOREACH this.subComponents»
>
>
> So you override already generated files and the protected region id
> collector emits these warn statements as it is served with already
> collected ids.
>
> Cheers,
> Joerg
>
|
|
|
Powered by
FUDForum. Page generated in 0.49336 seconds