Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "MDT/OCL/MDT-OCL 3.0.0 Migration Guide"

< MDT‎ | OCL
(New page: === Grammar changes === The Complete OCL grammar is defined by OCLParser.g, OCLLexer.g, OCLKWLexer.g. The Essential OCL grammar is now defined by EssentialOCL.g, EssentialOCLLexer.g, Ess...)
 
(Grammar changes)
Line 1: Line 1:
=== Grammar changes ===
+
== CST changes ==
 +
 
 +
The CST forms a largely internal API, so OCL applications should be unaffected by changes.
 +
 
 +
Implementers of derived languages may notice a number of simplifications and enhancements.
 +
 
 +
=== ClassifierContextDecl.invOrDefCS and InvOrDefCS.invOrDefCS ===
 +
 
 +
InvOrDefCSis now maintained as an ClassifierContextDecl.constraints array rather than a reverse ordered linked list.
 +
 
 +
Simplify your code.
 +
 
 +
=== EnumLiteralExpCS ===
 +
 
 +
This class no longer exists.
 +
 
 +
"A::b" is now parsed as a PropertyCallExpCS, allowing a trailing @pre.
 +
 
 +
Change code that disambiguated a PropertyCallExpCS from an EnumLiteralExpCS to disambiguate an EnumLiteralExpCS from a PropertyCallExpCS.
 +
 
 +
=== FeatureCallExpCS.pathNameCS ===
 +
 
 +
This is a new field to support qualified names. It is also used by static calls.
 +
 
 +
Change old code that detected an anomalous PathNameCS as the FeatureCallExpCS.source to use the FeatureCallExpCS.pathNameCS.
 +
 
 +
Write new coded to support qualified names.
 +
 
 +
=== IsMarkedPreCS and FeatureCallExpCS.isMarkedPreCS ===
 +
 
 +
@pre is now parsed to a null/non-null IsMarkedPreCS, avoiding creating objects for the predominant usage of no @pre.
 +
 
 +
Change any access to test for isMarkedPreCS.isPre() to test for isMarkedPreCS != null. (Failure to change this will give an NPE).
 +
 
 +
Any usage of a non-null IsMarkedPreCS can be optimised to exploit it's @pre-always behaviour.
 +
 
 +
=== PathNameCS.sequenceOfNames ===
 +
 
 +
This new simpleNames field comprising a list of SimpleNameCS replaces the old sequenceOfNames field comprising a list of String. This allows the token context of each path element to be accesses by CST applications.
 +
 
 +
Change code to invoke SimpleNameCS.getValue() to obtain the old string.
 +
 
 +
Use the AbstractOCLAnalayzer.createSequenceOfNames() method to create a list of strings from the list of SimpleNameCS.
 +
 
 +
=== PropertyContextCS.initOrDerValueCS and InitOrDerValueCS.initOrDerValueCS ===
 +
 
 +
InitOrDerValueCS is now maintained as an PropertyContextCS.constraints array rather than a reverse ordered linked list.
 +
 
 +
Simplify your code.
 +
 
 +
=== StateExpCS ===
 +
 
 +
This class no longer exists.
 +
 
 +
An oclIsInState call is now parsed as an ordinary operation call.
 +
 
 +
The AbstractOCLAnalyzer invokes oclIsInStateOperationCallExpCS().
 +
 
 +
== Grammar changes ==
  
 
The Complete OCL grammar is defined by OCLParser.g, OCLLexer.g, OCLKWLexer.g.
 
The Complete OCL grammar is defined by OCLParser.g, OCLLexer.g, OCLKWLexer.g.

Revision as of 01:44, 16 October 2009

CST changes

The CST forms a largely internal API, so OCL applications should be unaffected by changes.

Implementers of derived languages may notice a number of simplifications and enhancements.

ClassifierContextDecl.invOrDefCS and InvOrDefCS.invOrDefCS

InvOrDefCSis now maintained as an ClassifierContextDecl.constraints array rather than a reverse ordered linked list.

Simplify your code.

EnumLiteralExpCS

This class no longer exists.

"A::b" is now parsed as a PropertyCallExpCS, allowing a trailing @pre.

Change code that disambiguated a PropertyCallExpCS from an EnumLiteralExpCS to disambiguate an EnumLiteralExpCS from a PropertyCallExpCS.

FeatureCallExpCS.pathNameCS

This is a new field to support qualified names. It is also used by static calls.

Change old code that detected an anomalous PathNameCS as the FeatureCallExpCS.source to use the FeatureCallExpCS.pathNameCS.

Write new coded to support qualified names.

IsMarkedPreCS and FeatureCallExpCS.isMarkedPreCS

@pre is now parsed to a null/non-null IsMarkedPreCS, avoiding creating objects for the predominant usage of no @pre.

Change any access to test for isMarkedPreCS.isPre() to test for isMarkedPreCS != null. (Failure to change this will give an NPE).

Any usage of a non-null IsMarkedPreCS can be optimised to exploit it's @pre-always behaviour.

PathNameCS.sequenceOfNames

This new simpleNames field comprising a list of SimpleNameCS replaces the old sequenceOfNames field comprising a list of String. This allows the token context of each path element to be accesses by CST applications.

Change code to invoke SimpleNameCS.getValue() to obtain the old string.

Use the AbstractOCLAnalayzer.createSequenceOfNames() method to create a list of strings from the list of SimpleNameCS.

PropertyContextCS.initOrDerValueCS and InitOrDerValueCS.initOrDerValueCS

InitOrDerValueCS is now maintained as an PropertyContextCS.constraints array rather than a reverse ordered linked list.

Simplify your code.

StateExpCS

This class no longer exists.

An oclIsInState call is now parsed as an ordinary operation call.

The AbstractOCLAnalyzer invokes oclIsInStateOperationCallExpCS().

Grammar changes

The Complete OCL grammar is defined by OCLParser.g, OCLLexer.g, OCLKWLexer.g.

The Essential OCL grammar is now defined by EssentialOCL.g, EssentialOCLLexer.g, EssentialOCLKWLexer.g.

In MDT/OCL 1.3 EssentialOCL.g included a number of Complete OCL facilities such as reserved words, ^ and ^^ message operators and @pre suffixes. These are not present in MDT/OCL 3.0.0.


The MDT/OCL 3.0.0 grammar has been changed to align as closely as possible with the OMG OCL 2.1 concrete syntax and to provide the basis for a comprehensive grammar submitted for incorporation in a future OCL specification via resolution of Issues ...

This alignment causes the following changes.

MDT/OCL 1.3 production MDT/OCL 3.0.0 production
OperationCallExpCS operationCallExpCS

Back to the top