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 19:08 |
Luís de Sousa Messages: 214 Registered: July 2009 |
Senior Member |
|
|
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 15:24 |
Ed Willink Messages: 7655 Registered: July 2009 |
Senior Member |
|
|
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
>
>
|
|
| | |
Goto Forum:
Current Time: Fri Apr 19 22:26:18 GMT 2024
Powered by FUDForum. Page generated in 0.03508 seconds
|