Issue 15367: OCL 2.2 Add endlet to make grammar extensible (ocl2-rtf) Source: Model Driven Solutions (Dr. Edward Willink, ed(at)willink.me.uk) Nature: Uncategorized Issue Severity: 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. Resolution: Revised Text: Actions taken: July 9, 2010: received issue Discussion: End of Annotations:===== ronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhkGAPtXNkxUXebr/2dsb2JhbACTeIw/cb8ohScE Date: Fri, 09 Jul 2010 06:59:47 +0100 From: Ed Willink User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0 To: issues@omg.org Subject: OCL 2.2 Add endlet to make grammar extensible Hi 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. Regards Ed Willink