OCL 2.5 RTF Avatar
  1. OMG Issue

OCL25 — OCL 2.2 Add endlet to make grammar extensible

  • Key: OCL25-30
  • Legacy Issue Number: 15367
  • Status: open  
  • Source: Model Driven Solutions ( Ed Willink)
  • Summary:

    Further to Bran Selic's observation on Issue 15357 that UML-specifics should not really impact the OCL core. This is easy for State via a ModelLiteralExp, but hard for Message which has associated concrete syntax.

    The expression grammar could be made extensible to accommodate custom/orthogonal infix, prefix, suffix, precedence if an expression could be parsed by the generic:

    expr ::= affixed (infix affixed)*
    affixed ::= prefix* suffixed
    suffixed ::= atom (suffix | '(' expr ')' | '[' expr ']' | '

    {' expr '}

    ' )*
    atom ::= '(' expr ')'

    name
    'if' expr 'then' expr 'else' expr 'endif'
    'let' expr 'in' expr 'endlet'

    The major problem is the missing 'endlet', which makes accurate parsing difficult and complex expressions easy for humans to misinterpret too.

    Suggest introduce the 'endlet' keyword.

  • Reported: OCL 2.1 — Fri, 9 Jul 2010 04:00 GMT
  • Updated: Thu, 8 Oct 2015 14:11 GMT