eclipse-ocl / org.eclipse.ocl

Eclipse Public License 2.0
0 stars 0 forks source link

[ocl25] Migrate Xtext grammars, CS models to suit OCL 2.5 #1347

Open eclipse-ocl-bot opened 1 week ago

eclipse-ocl-bot commented 1 week ago

| --- | --- | | Bugzilla Link | 438489 | | Status | NEW | | Importance | P3 normal | | Reported | Jun 29, 2014 10:13 EDT | | Modified | Jul 02, 2014 13:35 EDT | | Blocks | 438488 | | Reporter | Ed Willink |

Description

Some parts of the Xtext grammars are not fit for an OMG specification. Tidy up.

eclipse-ocl-bot commented 1 week ago

By Ed Willink on Jul 01, 2014 10:41

QVTd branch ewillink/438489 demonstrates the successful elimination of all additional QVTd CSAttibution classes.

Mostly the code is cleaner.

A little care is needed when the container cannot be determined without assistance from the container. Mapping and Function inject themselves into their parent, so the overall model must put the root together in a solid dependence order.

AS objects need creating with a valid containment hierarchy as soon as possible so that the AS-based lookups do not fail.

eclipse-ocl-bot commented 1 week ago

By Ed Willink on Jul 01, 2014 13:17

Branch ewillink/438489 demonstrates the successful elimination of all additional OCLstdlib CSAttibution classes.

CompleteOCL CS attribution is unclear; obscured by out-of-favour approach o Package merging.

EssentialOCL VS attribution removal is hard. In order to resolve a reference the containment tree must be present. Therefore EssentialOCLCSLeft2RightVisitor must be two pass a) to create the Containment hierarchy, b) to create the cross-referencing. Limited benefit in doing this manually. The dependency-driven auto-generation should do it automatically.

Notionally a Left2Right containment pass should operate during the normal Containment pass. This implies that the AS node classes must be determined with very limited lookup to disambiguate for Type/Operation/Association/...

eclipse-ocl-bot commented 1 week ago

By Ed Willink on Jul 02, 2014 13:35

The complex decorated name parsing has been replaced by a much simpler NameExpCS clause with child CurlyBracketClauseCS, RoundBracketClauseCS, SquareBracketClauseCS; much simpler. The consequent disambuigaurtion localizes in the LtoR visitNameExpCS and vistNavigationOperatorCS (it would be nice to lose the latter).

Introducing a PivotableElementCSAttribution that redirects CS lookups to the AS provided the AS has a non-null eResource() enables many CSAttribution classes to be eliminated, in some cases clarifying differences in 'duplicate' code.

A major win is eliminating SpecificationCS, ContextCS and ExpSpecificationCS in favour of just ExpressionInOCLAttribution.

Not all EssentialOCL CS Attribution classes could go because in many cases the AS eContainer() path is broken till containment is done first.

OCLinEcore, OCLstdlib and QVTd are all free of CS Attribution classes.

CompleteOCL is harder because it really needs a top down creation. Not worth the rewrite now. Autogen might just do it right.

New CS2Pivot.lookupXXX methods indicate the lookup motivation and hide the lookup triggering proxy resolution. They also configure filters locally, hopefully removing the need for magic earlier configuration.

The main remaining magic is the ExpCS.sourceType that propagates the left hand knowledge to the right hand. Perhaps it should be computed on demand using the ImplicitSourceTypeIterator and then optimized away.

Overall, the Base Attribution classes could be very close to their auto-generateable equivalent. Probably need another simplification pass to eliminate NavigationOperatorCS intelligence.