OCL : from AST to concrete syntax

148 Views Asked by At

Evrything is in the title : I have an OCL AST (with as root an org.eclipse.ocl.ecore.Constraint) which I have modified. I would like to parse it again, but I only find the "one-line OCL grammar" that you get when printing a constraint (or any OCL thing) - provided in their toString() method.

Anybody knows a way to get a final parseable OCL string from an EMF OCL Constraint ? (or from any TypedElement) (or from any OCLExpression or ExpressionInOCL) ??

Thanks ! Edouard

1

There are 1 best solutions below

1
On

As I have answered a number of times on the Eclipse OCL Forum.... http://eclipse.org/forums/eclipse.modeling.mdt.ocl

If you use the old OCL you have old faclities.

If you use the new Pivot-based OCL you get new extensible facilities such as the PrettyPrinter.

Regards

Ed Willink