Skip to main content



      Home
Home » Modeling » OCL » Visiting expression from SpecificationCS
Visiting expression from SpecificationCS [message #1081872] Wed, 07 August 2013 16:07 Go to next message
Eclipse UserFriend
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 10:45 Go to previous message
Eclipse UserFriend
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: Wed Jul 02 22:30:29 EDT 2025

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

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

Back to the top