eclipse-ocl / org.eclipse.ocl

Eclipse Public License 2.0
0 stars 0 forks source link

[completeocl] Dreadful error recovery #1634

Open eclipse-ocl-bot opened 1 month ago

eclipse-ocl-bot commented 1 month ago

| --- | --- | | Bugzilla Link | 481129 | | Status | NEW | | Importance | P3 normal | | Reported | Oct 30, 2015 11:26 EDT | | Modified | Nov 28, 2017 04:10 EDT | | Reporter | Ed Willink |

Description

The "Let statements for collection of collections" OCL newsgroup thread gives an example where Complete OCL parser erro diagnosis is quite dreadful.

The Xtext grammar is:

ClassifierContextDeclCS returns ClassifierContextDeclCS:\ 'context' (ownedSignature=TemplateSignatureCS)? (selfName=UnrestrictedName)?\ ownedPathName=PathNameCS \ (('inv' ownedInvariants+=ConstraintCS)\ | ownedDefinitions+=DefCS )+;

and ...

DefPropertyCS returns DefPropertyCS:\ (isStatic?='static')? 'def' UnrestrictedName? ':' name=UnrestrictedName ':' ownedType=TypeExpCS

Potentially "def" could be something that should guide recovery.

Investigate 1: has the concept of restricted names caused the problem?

Investigate 2: if static def is promoted to ClassifierContextDeclCS, does the error recover work better?

eclipse-ocl-bot commented 1 month ago

By Ed Willink on Nov 28, 2017 04:10

The basic grammar is

keyword terms

A problem arises when the apparent number of trms is not tolerated by a particular keyword. Problem need error variants to accommodate e.g. no terms.