Bug 491574 - "directive: use-traditional-comparison-syntax"
Summary: "directive: use-traditional-comparison-syntax"
Status: NEW
Alias: None
Product: QVTo
Classification: Modeling
Component: Engine (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows NT
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-13 05:05 EDT by Ed Willink CLA
Modified: 2016-04-13 05:05 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Willink CLA 2016-04-13 05:05:49 EDT
The QVT 1.0 FTF added the following at the end of 8.4.4.

"The alternative '==' and '!=' notations can only be used if the source file pre-declares the intention of using them by means of a directive placed before entering the library of the transformation definitions. The syntax of this directive should be a comment having the following form:

-- directive: use-traditional-comparison-syntax, or
// directive: use-traditional-comparison-sysntax.

This declaration makes illegal the usage of the corresponding OCL-like syntax ('=' and '<>') within the compilation unit."

Consequently:

An ordinary QVTo source module may use "=" and "<>" but not "==" or "!="

A QVTo source annotated with the 'traditional' directive may use "==" and "!=" but not "=" or "<>".

Eclipse QVTo appears to ignore the directive and allow "=", "<>", "!=" but not "==".

Suggest implement the specification, thereby discouraging these confusing Java-isms. To avoid a backward compatibility problem, allow the wrong spellings with warnings.

Implementation-wise, it makes sense to always parse all forms so that the resolution is in the semantics without requiring a mode-dependent lexer/parser.