Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Increment of Int in while loop?
Increment of Int in while loop? [message #1827743] Fri, 22 May 2020 10:40 Go to next message
Fatima Rani is currently offline Fatima RaniFriend
Messages: 22
Registered: April 2020
Junior Member
hi!

how can we do this syntax in Acceleo
int x=0;
while ( x < =5)
{
x = x+1;
}

Regards,
Fatima
Re: Increment of Int in while loop? [message #1827747 is a reply to message #1827743] Fri, 22 May 2020 12:01 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Acceleo exploits OCL which is a declarative language; nothing changes, new things are computed.

Your snippet has at least 3 non-Acceleo ststements, so I suspect you are on the newsgroup.

If you really want to make progress declaratively you need to step back and decide what you need to do, not how you would have solved it in a precedural language such as Java.

From what your example tells us, the obvious answer is "let x = 5 in ...."

Regards

Ed Willink
Previous Topic:[Acceleo] Remove trailing white spaces in generated Java wrapper
Next Topic:XPAND parser exception contains wrong line number
Goto Forum:
  


Current Time: Thu Apr 25 15:55:49 GMT 2024

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

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

Back to the top