0
votes

I am trying to find a parser for OCL that can generate an Ecore model File so that I can use model to model methods in order to transform the OCL statements into other language models, e.g OCL to SQL (but not only to SQL).

Does anyone know how to OCL to Ecore converter?

3

3 Answers

0
votes

The MDT project supports OCL: http://www.eclipse.org/modeling/mdt/?project=ocl There is an EMF metamodel of the OCL language so you can use it for your transformation.

0
votes

You need to override ToStringVisitor Class in eclipseOCL.

0
votes

There is no implementable standard model representation for OCL, but Eclipse OCL prototypes a solution to the many problems with the OMG OCL specification.

Using Eclipse OCL you can use OCL->Save Abstract Syntax within OCLinEcore or Complete OCL editors to create a model that conforms to Pivot.ecore.

See http://git.eclipse.org/c/ocl/org.eclipse.ocl.git/tree/plugins/org.eclipse.ocl.pivot/model-gen/OCL-2.5.oclas for a model of the OCL standad library.