|[mdt-ocl.dev] Announcing the OCL 2 Java code generator|
HiThe OCL 2 Java code generator has now been pushed to master, however because of cyclic dependencies via Acceleo, it cannot be included in the Core build. Hopefully a Tools build will be available soon. In the meantime fetch examples/org.eclipse.ocl.examples.codegen from GIT.
Examples of generated code may be found in org.eclipse.ocl.examples.xtext.tests/src/codegen/company.*
where CodegencompanyTables provides the dispatch tables impl/*Impl contains the API conversion calls to the OCL bodies bodies/*Bodies contains the per-class OCL bodiesAll the current delegates tests pass successfully handling recursions, tuples and allInstances on Ecore without needing a dynamic pivot model.
Only slight difference is the severity and spelling of the default "is not satisfied" message.
Code generation can be enabled/disabled by <genAnnotations source="http://www.eclipse.org/OCL/GenModel"> <details key="Use Delegates" value="false"/> </genAnnotations>in the GenModel. The default is to not use delegates so just install (or import and invoke a run-time Eclipse) the ocl.examples.codegen plugin and re-genmodel to replace delegates by direct code.
Axel: A similar annotation could enable whatever is appropriate for activating the Impact Analyzer.
Regards Ed Willink
Back to the top