Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Iterative expression
[ATL] Iterative expression [message #86022] Mon, 07 July 2008 11:32 Go to next message
Eclipse UserFriend
Originally posted by: luciananegri81.yahoo.it

Hello,
I've a questions. I would want iterate on a variable of integer type
and not on an instance. It's possible?
If it's possible, which iterative expression I do use?
Sorry for my english.

Thanks

Lu
Re: [ATL] Iterative expression [message #86456 is a reply to message #86022] Sat, 12 July 2008 20:08 Go to previous message
Max Bureck is currently offline Max BureckFriend
Messages: 72
Registered: July 2009
Member
Hello,

I didn't find a way. But this helpers may be useful:

-- returns a sequence of integers from self to end
helper context Integer def: To(end:Integer):Sequence(Integer) =
if self=end then Sequence{self}
else
if self>end then self->To(end+1)->including(end)
else self->To(end-1)->including(end)
endif
endif;

-- returns a sequence of numbers from 0 to self
helper context Integer def: count():Sequence(Integer) =
0->To(self);

With that helpers you can create sequences of integers to iterate over.
But I guess you won't get high performance with that, especially for
high numbers.

Greetings,
Max

> Hello,
> I've a questions. I would want iterate on a variable of integer type and
> not on an instance. It's possible?
> If it's possible, which iterative expression I do use?
> Sorry for my english.
>
> Thanks
>
> Lu
>
Previous Topic:References in ATL output
Next Topic:question to modelmodification with ATL
Goto Forum:
  


Current Time: Fri Apr 26 03:37:36 GMT 2024

Powered by FUDForum. Page generated in 0.02692 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top