Skip to main content



      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 06:40 Go to next message
Eclipse UserFriend
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 08:01 Go to previous message
Eclipse UserFriend
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: Sat Jun 21 11:12:54 EDT 2025

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

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

Back to the top