|
Re: [Acceleo] Netlist Generation (nested loops+ variables?) [message #1690209 is a reply to message #1690179] |
Wed, 25 March 2015 12:58  |
Eclipse User |
|
|
|
Can this be marked as solved?
I just wanted to let you know that I solved the issues with a simple parameterized template call. I was just not seeing it a few hours ago. Thank you
[comment Connections/]
[for (p:Package | aModel.eContents(Package))]
[if (p.name = 'Testbenches')]
[for (c:Class | p.eContents(Class))]
[for (parts:Property | c.eContents(Property))]
[let myPartsName : String = parts.name]
[for (p:Package | aModel.eContents(Package))]
[if (p.name = 'scp_comlib')]
[for (cl:Class | p.eContents(Class))]
[if parts.type.name = cl.name]
[for (property :Property | cl.ownedElement->select(p | p.oclIsKindOf(Port)))]
[myPartsName/].[property.name/]([generateConnectors(c, myPartsName, property.name)/]
[/for]
[/if]
[/for]
[/if]
[/for]
[/let]
[/for]
[/for]
[/if]
[/for]
[template public generateConnectors(c:Class, myPartsName:String, myPortName:String)]
[for (property :Feature | c.ownedElement->select(p | p.oclIsKindOf(Connector)))]
[for (cend:ConnectorEnd | property.eContents(ConnectorEnd))]
[if myPartsName = cend.partWithPort.name and myPortName= cend.role.name]
[property.name/]);
[/if]
[/for]
[/for]
[/template]
|
|
|
Powered by
FUDForum. Page generated in 0.04064 seconds