Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » [OCLInEcore] Complex expressions with @pre
[OCLInEcore] Complex expressions with @pre [message #553397] Tue, 17 August 2010 12:10 Go to next message
Toñi  Reina is currently offline Toñi ReinaFriend
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 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
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
Previous Topic:[OCLInEcore] Comments disappear when saving the .ecore file
Next Topic:[OCLInEcore] Operator ^
Goto Forum:
  


Current Time: Tue Sep 24 15:21:45 GMT 2024

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

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

Back to the top