eclipse-ocl / org.eclipse.ocl

Eclipse Public License 2.0
0 stars 0 forks source link

Gratuitous IsMarkedPreCS #347

Closed eclipse-ocl-bot closed 5 hours ago

eclipse-ocl-bot commented 5 hours ago

| --- | --- | | Bugzilla Link | 255599 | | Status | CLOSED FIXED | | Importance | P3 enhancement | | Reported | Nov 18, 2008 02:17 EDT | | Modified | May 27, 2011 02:41 EDT | | Reporter | Ed Willink |

Description

The parser currently creates IsMarkedPreCS nodes whenever possible and parameterises them with pre=true/false.

Consequently hovering in a CST-driven text editor can show an unwanted IsMarkedPreCS when hovering where an @pre might have been present.

The CST model defines the 'isMarkedPreCS' child as optional (and also the pre attribute as optional!). The parser actions are already coded to take account of trailing isMarkedPreCS not having valid tokens (although they do). The analyzer is coded assuming 'isMarkedPreCS' is mandatory.

Would it be an API change to use a null isMarkedPreCS node when no @pre is present? IsMarkedPreCS.pre could then be deprecated and default true. Parser and analyzer actions would need trivial change.

eclipse-ocl-bot commented 5 hours ago

By Christian Damus on Nov 30, 2008 16:17

(In reply to comment #0)\

Would it be an API change to use a null isMarkedPreCS node when no @pre is present? IsMarkedPreCS.pre could then be deprecated and default true. Parser and analyzer actions would need trivial change.

No, the API contract indicates that this element is optional, so clients should expect that it could be absent.

eclipse-ocl-bot commented 5 hours ago

By Christian Damus on Nov 30, 2008 16:32

Updated the AbstractOCLParser to append the IsMarkedPreCS only when the @pre was actually present.\ Concomitant update to the AbstractOCLAnalyzer to desist in assuming that it will always be present.

Fix committed to HEAD (1.3 branch).

eclipse-ocl-bot commented 5 hours ago

By Ed Willink on Dec 01, 2008 01:50

Changing invocations of createIsMarkedPreCS(false) to null would give further benefits by not creating as well as not using unnecessary IsMarkedPreCS nodes (if the API will allow).

You missed one potential call of isAtPre in createFeatureCallExpCS.

eclipse-ocl-bot commented 5 hours ago

By Christian Damus on Dec 01, 2008 09:08

(In reply to comment #3)

Changing invocations of createIsMarkedPreCS(false) to null would give further benefits by not creating as well as not using unnecessary IsMarkedPreCS nodes (if the API will allow).

That's why I didn't do it.

You missed one potential call of isAtPre in createFeatureCallExpCS.

Ah, so I did. That will go out with the changes for bug 251349.

eclipse-ocl-bot commented 5 hours ago

By Christian Damus on Dec 04, 2008 10:35

Fix available in HEAD: 1.3.0.I200812021600.

eclipse-ocl-bot commented 5 hours ago

By Ed Willink on May 27, 2011 02:40

Closing after over a year in verified state.

eclipse-ocl-bot commented 5 hours ago

By Ed Willink on May 27, 2011 02:41

Closing after over a year in verified state.