Bug 497159 - [cs2as] Review policy of lookup error handling
Summary: [cs2as] Review policy of lookup error handling
Status: NEW
Alias: None
Product: QVTd
Classification: Modeling
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-01 11:35 EDT by Adolfo Sanchez-Barbudo Herrera CLA
Modified: 2016-07-01 12:13 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adolfo Sanchez-Barbudo Herrera CLA 2016-07-01 11:35:33 EDT
There is a default policy in which when a name-based lookup fails (no results) an error handling is performed. This error handling simply accumulates the occurring "errors" with the ultimate goal of producing error markers in the Xtext editors.

Currently the error handling tracks which is the CS object (normally an object which holds a name) in order to highlight the ill-formed name that is not found.

This needs revision, due to different issues:
a) There are some name resolutions which are performed with no CS object/info. For instance, when a 'self' Variable needs to be found for an *implicit* 'self' VariableExp (e.g. x.y as a shorthand of self.x.y)
b) There are some name resolutions performed during CS2AS with the sole of disambiguate, hence we don't want to report errors. 

A more fundamental debate is if these "errors" should be gathered (for further report) when performing the CS2AS transformation. Perhaps, they could be reported in a later stage in a different way. For instance, if the AS element doesn't have a mandatory reference computed, then find the corresponding CS element which will help to report the error. On the other hand, this requires well defined AS meta-models, and a CS2AS solution should be able to identify this kind of failures (name-based lookup failures) without any regard of well designed AS meta-models.
Comment 1 Adolfo Sanchez-Barbudo Herrera CLA 2016-07-01 11:53:39 EDT
asanchez/497159 contains a commit to help with a)
Comment 2 Ed Willink CLA 2016-07-01 12:13:21 EDT
(In reply to Adolfo Sanchez-Barbudo Herrera from comment #0)
> A more fundamental debate is if these "errors" should be gathered (for
> further report) when performing the CS2AS transformation.

Usability drives a solution. Every error should be reported once (not twice or omitted.) Validation of the AS should report all AS errors since the AS might be produced by other than CS2AS tooling.

Therefore anything that can be reported from the AS should be reported by AS validation.

Anything that inhibits production of an AS and so is not reportable in the AS should be reported by the CS2AS.