Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » equivalent this code in Acceleo
icon5.gif  equivalent this code in Acceleo [message #1761060] Fri, 05 May 2017 19:30 Go to next message
nihad rahabi is currently offline nihad rahabiFriend
Messages: 13
Registered: March 2017
Junior Member
Hi,
what is the equivalent of this code in acceleo language
For (i=0 to n )
if( i= 2)then
i+2;
end if
end for



thank you
Re: equivalent this code in Acceleo [message #1761072 is a reply to message #1761060] Sat, 06 May 2017 05:14 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 5585
Registered: July 2009
Senior Member
Hi

The equivalent is nothing in all languages since your code does nothing.

Perhaps the Sequence{0..n}->collect(i | ...) idiom may be what you are looking for.

Regards

Ed Willink
Re: equivalent this code in Acceleo [message #1761077 is a reply to message #1761072] Sat, 06 May 2017 08:05 Go to previous messageGo to next message
nihad rahabi is currently offline nihad rahabiFriend
Messages: 13
Registered: March 2017
Junior Member
Hi,
My goal is not the example , I know it does not indicate anything
but my goal is The assignment operator(i:=i+2)
I found in acceleo the key word (replace) but he didn't work
thank you
Re: equivalent this code in Acceleo [message #1761078 is a reply to message #1761077] Sat, 06 May 2017 08:12 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 5585
Registered: July 2009
Senior Member
Hi

Acceleo is a declarative language; no anarchic assignments.

Try Sequence{0..n}->excluding(3)->... if you want to omit 2 from the loop.

Regards

Ed Willink
Re: equivalent this code in Acceleo [message #1761081 is a reply to message #1761078] Sat, 06 May 2017 09:32 Go to previous message
nihad rahabi is currently offline nihad rahabiFriend
Messages: 13
Registered: March 2017
Junior Member
HI,
ok i understand now thanks for help.

Previous Topic:how can we get DataType values in Acceleo
Next Topic:Inquire about the topic( Acceleo and tree)
Goto Forum:
  


Current Time: Mon Jan 22 12:45:42 GMT 2018

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

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