Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Visiting expression from SpecificationCS
Visiting expression from SpecificationCS [message #1081872] Wed, 07 August 2013 20:07 Go to next message
John Guerson is currently offline John GuersonFriend
Messages: 51
Registered: August 2011
Member
Hi,

I was wondering to know if there is a way to visit an OCL expression from SpecificationCS.


import org.eclipse.ocl.examples.xtext.base.baseCST.SpecificationCS;
import org.eclipse.ocl.examples.xtext.completeocl.completeOCLCST.ContextConstraintCS;

if (((ContextConstraintCS)tocl_prop) instanceof InvCS)
    SpecificationCS spec = tocl_prop.getSpecification();



Perhaps I need to transform the SpecificationCS into some AST form. I really appreciate any help.

Regards,
John

Re: Visiting expression from SpecificationCS [message #1082423 is a reply to message #1081872] Thu, 08 August 2013 14:45 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 4150
Registered: July 2009
Senior Member
Hi

It's best to avoid the CS model, since that will remain
proprietary/Xtext-friendly. You should use the Pivot model which is
evolving towards a UML-aligned standard.

The CS2Pivot orchestrates the translation, possibly using
org.eclipse.ocl.examples.pivot.OCL.cs2pivot(), although you'll find most
of the JUnit tests dive in underneath since the OCL facade is still
evolving.

You should probably be aiming to use the ExpressionInOCL class since
that contains not only the expression body but also the contextual
parameters.

Regards

Ed Willink


On 07/08/2013 21:07, John Guerson wrote:
> Hi,
>
> I was wondering to know if there is a way to visit an OCL expression
> from SpecificationCS.
>
>
> import org.eclipse.ocl.examples.xtext.base.baseCST.SpecificationCS;
> import
> org.eclipse.ocl.examples.xtext.completeocl.completeOCLCST.ContextConstraintCS;
>
> if (((ContextConstraintCS)tocl_prop) instanceof InvCS)
> SpecificationCS spec = tocl_prop.getSpecification();
>
>
>
> Perhaps I need to transform the SpecificationCS into some AST form. I
> really appreciate any help.
>
> Regards,
> John
>
>
Previous Topic:Parsing an ocl file (complete OCL) to define operations in an environment
Next Topic:enabling OCL to parse user definded functions
Goto Forum:
  


Current Time: Sat Nov 22 17:05:23 GMT 2014

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

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