[OCLInEcore] Complex expressions with @pre [message #553397] |
Tue, 17 August 2010 12:10 |
Toñi Reina Messages: 209 Registered: July 2009 |
Senior Member |
|
|
Hi all,
I'm writing a metamodel with relatively complex ocl expressions, the
problem is that when I write a "complex" expression such as
(attribute.operation())@pre, OCLInEcore reports an error. However, if I
write a more simple expression, such as attribute@pre, there is no errors.
On the other hand, I'm also testing the expressions in the
OCLInteractive Interpreter. The expression (attribute.operation())@pre
is executed by the interpreter without errors.
Does OCLInEcore and the OCL interpreter understand the same kind of
expressions? If this is true, then ¿is the validation of the complex
expression a bun in OCLInEcore or is a not valid expression?
Thanks in advance,
Toñi
|
|
|
Re: [OCLInEcore] Complex expressions with @pre [message #553522 is a reply to message #553397] |
Tue, 17 August 2010 19:22 |
Ed Willink Messages: 7670 Registered: July 2009 |
Senior Member |
|
|
Hi Toni
@pre is only valid in a post-condition and so only valid in Complete
OCL, so you cannot use it in OCLinEcore. That it works at all is because
it is difficult to omit @pre completely from EssentialOCL and then
introduce it in CompleteOCL. In due course you should get semantic errors.
The MDT/OCL Examples Xtext-based editors use an LL ANTLR grammar,
whereas the main MDT/OCL core uses an LALR LPG grammar. These are
supposed to be the same, but are not yet.
Regards
Ed Willink
On 17/08/2010 13:10, Toñi Reina Quintero wrote:
> Hi all,
>
> I'm writing a metamodel with relatively complex ocl expressions, the
> problem is that when I write a "complex" expression such as
> (attribute.operation())@pre, OCLInEcore reports an error. However, if I
> write a more simple expression, such as attribute@pre, there is no errors.
>
> On the other hand, I'm also testing the expressions in the
> OCLInteractive Interpreter. The expression (attribute.operation())@pre
> is executed by the interpreter without errors.
>
> Does OCLInEcore and the OCL interpreter understand the same kind of
> expressions? If this is true, then ¿is the validation of the complex
> expression a bun in OCLInEcore or is a not valid expression?
>
> Thanks in advance,
> Toñi
|
|
|
Powered by
FUDForum. Page generated in 0.06287 seconds