OCL 2.3 RTF Avatar
  1. OMG Issue

OCL23 — Inconsistent lookup for underscored symbols

  • Key: OCL23-9
  • Legacy Issue Number: 14224
  • Status: closed  
  • Source: Individual ( Alexander Igdalov)
  • Summary:

    Description:

    9.3 Concrete Syntax
    As a convention to the concrete syntax, conflicting properties or conflicting class names can be aliased using the «» (underscore) prefix. Inside an OCL expression that is written with the concrete syntax, when a property name or a class name is found to start with a «›, firstly the symbol is lookup in the metamodel. If not found, the same symbol with the «_» skipped is tried.

    Should be

    As a convention to the concrete syntax, conflicting properties or conflicting class names can be aliased using the «» (underscore) prefix. Inside an OCL expression that is written with the concrete syntax, when a property name or a class name is found to start with a «», the symbol with the «_» skipped is looked up in the metamodel.

    Explanation: Consider that some class in the metamodel has two properties called '_self' and 'self' correspondingly. With the resolution rule defined in 9.3 one can never access 'self' property. On one hand, you cannot refer to it directly because it clashed the keyword self. One the other hand, '_self' would refer to '_self' property according to 9.3. Thus, both variants 'aClass.self' and 'aClass._self' are not helpful here.

  • Reported: OCL 2.1 — Thu, 27 Aug 2009 04:00 GMT
  • Disposition: Resolved — OCL 2.3
  • Disposition Summary:

    Discussion:
    Issue 14357 introduces a new underscore-prefix string syntax (_'self') to access awkward
    spellings. This solves the problem of accessing either _'self' or _'_self'.

  • Updated: Fri, 6 Mar 2015 20:58 GMT