[ATL] Help with helpers needed -work-around for unsupported registration [message #102925] |
Mon, 06 April 2009 10:39  |
Eclipse User |
|
|
|
Hello,
I am trying to make a transformation that recursively splits a list using
helpers.
I tried to make a helper with a collection as context. I got an
"Unsupported registration..." warning. I read that it is impossible to use
a collection as context.
( http://www.sciences.univ-nantes.fr/lina/atl/www/atl_discussi on_archive/0324.html)
Therefore I rewrote my helper in such a way that it takes a collection as
a parameter. Now it looks like this:
helper def: getStatementsThroughFirstSend(s: Sequence(slco!Statement)):
Sequence(slco!Statement) =
let i: Integer = s.getIndexOfFirstSend()
in s->asSequence()->subSequence(0, i);
The problem is now that I want to call this helper from another helper as
follows:
helper context slco!Transition def: splitStatementList():
Sequence(Sequence(slco!Statement)) =
if self.hasEffectSendStatements()
then getStatementsThroughFirstSend(self.effect->asSequence())
else Sequence{}
endif;
This results in a syntax error at the point where I try to invoke the
function in the then clause.
In the slco metamodel, on the transition metaclass "effect" is an ordered
reference.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.13732 seconds