Visiting expression from SpecificationCS [message #1081872] |
Wed, 07 August 2013 16:07  |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.12385 seconds