Skip to main content



      Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] Boolean operators in version 3.2
[Acceleo] Boolean operators in version 3.2 [message #901400] Sat, 11 August 2012 15:08 Go to next message
Eclipse UserFriend
Dear all,

I need to perform a boolean comparison in an if block. Something like:

[if (class.getTaggedValue(class, 'Stereotype', 'initRandom') == 'TRUE')]

According to the 2.6 reference manual, the following operators should be available (page 9):

Quote:
== (equal), != (different), < (less than), <= (less or equal than), > (greater than >= (greater than or equal), || (logical or), && (logical and) and ! (negation)


But whenever I use them I get this error: "=" unexpected token(s). Am I doing something wrong? Or have the boolean operators changed since version 2.6?

Thank you,

Luís

Re: [Acceleo] Boolean operators in version 3.2 [message #901455 is a reply to message #901400] Sun, 12 August 2012 11:24 Go to previous messageGo to next message
Eclipse UserFriend
Hi

I've no idea about 2.x, but Acceleo 3.x complies with the OMG MOFM2T
specification that is based on OCL, for which the relational operators are

=, <>, <=, <, >, >=

and the literals are

true, false

Regards

Ed Willink

On 11/08/2012 20:08, Luís de Sousa wrote:
> Dear all,
>
> I need to perform a boolean comparison in an if block. Something like:
>
> [if (class.getTaggedValue(class, 'Stereotype', 'initRandom') == 'TRUE')]
>
> According to the 2.6 reference manual, the following operators should
> be available (page 9):
>
> Quote:
>> == (equal), != (different), < (less than), <= (less or equal than), >
>> (greater than >= (greater than or equal), || (logical or), &&
>> (logical and) and ! (negation)
>
>
> But whenever I use them I get this error: "=" unexpected token(s). Am
> I doing something wrong? Or have the boolean operators changed since
> version 2.6?
>
> Thank you,
>
> Luís
>
>
Re: [Acceleo] Boolean operators in version 3.2 [message #901522 is a reply to message #901455] Mon, 13 August 2012 04:44 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

The answer provided by Ed is correct "==" is not valid in Acceleo 3 (use "=" instead). Acceleo 2.x and Acceleo 3.x do not use the same languages so there are some differences. You can have a look at the documentation of the language and all its available operations.

Regards,

Stephane Begaudeau, Obeo

--
Twitter: @sbegaudeau & @acceleo
Google+: stephane.begaudeau & acceleo
Blog: http://stephanebegaudeau.tumblr.com
Acceleo Documentation: http://docs.obeonetwork.com/acceleo
Re: [Acceleo] Boolean operators in version 3.2 [message #901647 is a reply to message #901522] Mon, 13 August 2012 16:01 Go to previous message
Eclipse UserFriend
Thanks to both for the replies. Using the "=" character things work fine.

Luís
Previous Topic:Questions about generation code for Objective C and small games for iPhone
Next Topic:Acceleo meta-model as namespace
Goto Forum:
  


Current Time: Thu Jul 17 09:40:48 EDT 2025

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

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

Back to the top