[Xpand2] Looping (for loop / do while loop / while loop) [message #551993] |
Tue, 10 August 2010 09:00  |
Eclipse User |
|
|
|
Is there a way to express loops within Xpand2 templates? That is, I would like to have some Xpand2 statements repeated until some particular condition is no longer met.
As I can see right now, using collections together with the "EXPAND...FOREACH" statement or the "FOREACH" statement is the only way to have loops out of the box.
Background: My metamodel has a class "Element" with a reference "nextElement" on itself. Instances of this metamodel can have several elements forming a linked list (i.e. someElement.nextElement points on someOtherElement.... someOtherElement.nextElement could point on yetAnotherElement and so on).
I'd like to generate text using an Xpand2 template which walks along this linked list, stopping when nextElement points to "null".
|
|
|
|
Powered by
FUDForum. Page generated in 0.07803 seconds