Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

OCL

(Redirected from MDT-OCL)

The Eclipse OCL Project provides an implementation of the Object Constraint Language (OCL) OMG standard for EMF-based models.

The Core OCL component provides the following capabilities to support OCL integration:

  • Defines APIs for parsing and evaluating OCL constraints and queries on EMF models.
  • Defines Ecore and UML implementations of the OCL abstract syntax model, including support for serialization of parsed OCL expressions.
  • Provides a Visitor API for analyzing/transforming the AST model of OCL expressions.
  • Provides an extensibility API for clients to customize the parsing and evaluation environments used by the parser.

The Core OCL parser is generated by the LALR Parser Generator.

The additional OCL Examples and Editors component provides interactive support for OCL:

  • Provides an Interactive OCL Console to evaluate queries on models.
  • Provides an OCLinEcore Xtext editor for OCL embedded in an Ecore meta-model.
  • Provides a CompleteOCL editor for an OCL document complementing a meta-model.
  • Provides an EssentialOCL editor for individual OCL expressions.

The grammars for the Xtext-based editors auto-generate ANTLR parsers. In Eclipse OCL 3.0, the ANTLR parsers are used solely within the editors. As from Eclipse OCL 3.1 the Xtext grammars and parsers provide full evaluation and validation capabilities too. Since the Xtext grammars are associated with a re-engineering to support a model-defined standard library and full OMG compliance, the original LPG parser will be increasingly deprecated.

Downloads and Updates

For Users

Eclipse OCL may be installed directly from the main Eclipse http://download.eclipse.org/releases/photon/ Update Site.

or from an OCL-specific site: http://download.eclipse.org/modeling/mdt/ocl/updates. The Eclipse OCL Repositories and Updates for Milestone, Interim and Nightly builds are described in P2 Repositories Organization and retained in accordance with the Retention Policy.

The OCL Examples and Editors SDK feature provides the full IDE comprising Xtext-based editors, Interactive Console, Debugger and Java Code Generator all using the new Unified Pivot -based OCL.

The OCL End User SDK feature provides the Classic OCL support with distinct Ecore and UML APIs.

Eclipse OCL may be installed indirectly by downloading an archive ZIP from Project Downloads and then using the downloaded ZIP as the Works with site for Help->Install New Software...

Eclipse OCL has Open Bugs and a newsgroup or forum. See the OCL Forum Netiquette.

For Developers

An Eclipse OCL development environment may be created automatically using the OOMPH Eclipse Installer. Follow the OOMPH instructions to first create an Eclipse installation with a Java VM, then invoke File->Import Projects->Oomph->Projects into Workspace->Eclipse Projects->OCL->Development. After a few minutes the required dependencies have been downloaded and a restart is required. Then after a few tens of minutes the required GIT repositories have been cloned and you are ready to go; there should be no errors in the Problems View. You may wish to select Working Sets as the top level elements in the Package Explorer. You may Run->Run Configurations...->JUnit->org.eclipse.ocl.examples.xtext.tests (standalone) to demonstrate that the standard tests are passing.

Alternatively an Eclipse OCL development environment may be created manually using the Eclipse OCL source code from git://git.eclipse.org/c/ocl/org.eclipse.ocl.git, http://git.eclipse.org/c/ocl/org.eclipse.ocl.git and github Network. All source projects may be installed by Import...->Team->Team Project Set, then entering http://git.eclipse.org/c/ocl/org.eclipse.ocl.git/plain/releng/org.eclipse.ocl.releng/psfs/ocl-all.psf?h=master as the URL for import. Be patient; the repository clone takes a while, and there are no obvious progress indicators during the third phase while projects are actually created.

If you plan to contribute to Eclipse OCL, please have a look to the project Developer Resources

LPG Download

LALR Parser Generator is a SourceForge project, licensed under the EPL v1.0. It can in principle be downloaded from the LPG home page. However the underlying source code was maintained using CVS for which SourceForge has terminated support. The code has not been migrated to GIT, but the CVS remains accessible in readonly form. You may therefore access it with a CVS client such as TortoiseCVS for which the last (?ever) release still seems to works on Windows 11 in 2023. You may also use the traditional Eclipse CVS client provided you use a compatible, perhaps <= 2020-12, Eclipse platform; newer platforms have removed critical internal team APIs required by the CVS support.

The minimal LPG functionality is the lpg.runtime.java bundle which is distributed as part of Eclipse OCL and is redistributed from Orbit Bundle. This enables Classic OCL and QVTo parsers to run.

The fuller LPG functionality is only required if you want to modify and/or regenerate parser code from the grammars. This requires the lpg.generator bundle and architecture-specific fragment. Since obtaining these from CVS has become difficult, you may for now download a ZIP of the generator projects from Zipped lpg.generator projects; just File->Import..->Existing Projects into Workspace. You may monitor [1] to track progress on providing friendlier support.

Documentation, Publications and FAQs

Example Code

Releases and Development

You may want to check the New and Noteworthy features of the Eclipse OCL releases.

Planning

API Changes

API Tooling

The standard Eclipse API tooling is used to ensure stability of the Classic OCL plugins. Since very little development of Classic OCL occurs, maintaining stability is not too difficult.

The standard Eclipse API tooling is also used to ensure stability of the org.eclipse.ocl.pivot plugin.

However strict API tooling inhibits most change, but any change to an EMF model adjust numerous logically internal constants. Clearly any deletion is bad; some client might use the deleted facility. Unfortunately any addition is also bad since a derived client may have already added a same-named facility. Change is therefore limited to function bodies and private additions.

org.eclipse.ocl.pivot evolution is therefore more prgamatic. Additions are permitted; clients may need to recode to avoiud name clashes. Numerous API filters are applied to placate the API tooling. Unfortunately use of numerous API filters lreads to a dangerous just-filter-it development culture potentially negating the benefits of API tooling. Therefore, see [2], a new approach is being taken. EMF model changes are made on baseline branch, and filtered mercilessly. Best endeavours are made to preserve old names and often old functionality. The master branch merges the baseline branch, avoiding EMF model changes swaping the API tooling. The baseline branch is used to create nightly builds with a BYYYYMMDD alias. The latest BYYYYMMDD build is used as the baseline for regular builds.

Architecture

The remainder of this section has links to pages of interest primarily to those developing the OCL component.

Development Environment

Release Engineering

Obsolete

Sponsors

Thanks to the following organizations who support the Eclipse OCL project with infrastructure and software

Eclipse Foundation

YourKit

Yklogo.png

YourKit supports open source projects with its full-featured Java Profiler. YourKit, LLC is the creator of YourKit Java Profiler and YourKit .NET Profiler, innovative and intelligent tools for profiling Java and .NET applications.

Related Links

Back to the top