Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[mdt-ocl.dev] MDT OCL Behavioural customisation

Hi All

In Bug 258633 I added ParsingOptions.SUPPORT_STATIC_FEATURES to allow user customisation of the treatment of the new OCL 2.1 'static' keyword.

In Bug 288040 my patch adds ParsingOptions.WARN_OF_XOR_OR_AND_PRECEDENCE_CHANGE to allow user cistomisation of a warning that OCL 2.1 and OCL 2.0 have a different interpretation for a user's expression.

These options use facilities that Christian introduced to control extensions e.g. ParsingOptions.USE_BACKSLASH_ESCAPE_PROCESSING.

------------------

Adolfo has expressed disquiet about this usage, so we should discuss our policy.

------------------

My inspiration comes from

JDT. A substantial set of preferences allows user customisation of @Override, import, redundant null check etc.

gcc. Many extensions are ciustomisable. +strict chooses a predefined exactly ISO specification set of selections.

Visual C++. #pragmas allow the treatment of each warning and error to be controlled.

-----------------

I feel that we should give the user an opportunity to control debatable behaviour.

At a low level each ParsingOptions controls a debatable behaviour.

At a high level we can add a new helper function such as:

OCL.setOptions(env, ParsingOptions.OCL_2_1);

to support selection a standard configuration.

In GUI preference pages we can allow non-programmatic customisation.

------------------

With the OCL 2.0 and 2.1 specifications so contradictory, we will not be able to achieve an unarguable set of OCL 2.0 or 2.1 behaviours. If someone wants compatibility with another OCL implementation
we should try to allow tailoring.

Some syntax changes such as 'static' are very clear cut. In OCL 2.1. Not in OCL 2.0.

Some languages changes are very naughty. The change in xor-or-and precedence is very
clear cut between 2.1 and 2.0.

For these changes I feel we must help the user by allowing them to configure MDT/OCL to
check that their OCL is comparible with a desired behavioural feature set.

   Regards

      Ed Willink




Back to the top