OCL Precedence rules
(Created page with "The precedence order for the operations, starting with highest precedence, in OCL is: * dot and arrow operations: “.” and “->” * unary “not” and unary minus *...")
 
No edit summary
Line 1: Line 1:
The precedence order for the operations, starting with highest precedence, in OCL is:
The precedence order for the operations, starting with the highest precedence, in OCL is:
* dot and arrow operations: “.” and “->”  
* dot and arrow operations: “.” and “->”  
* unary “not” and unary minus  
* unary “not” and unary minus  
Line 11: Line 11:
Parentheses “(“ and “)” can be used to change precedence.
Parentheses “(“ and “)” can be used to change precedence.


'''Note!''' This is not exactly according to current OCL standard. In standard OCL, “and”, “or,”, “xor” and “implies” has lower precedence than “<“, “>”, “<=”, “>=”, “=”, “<>”
'''Note!''' This is not exactly according to the current OCL standard. In standard OCL, “and”, “or”, “xor” and “implies” have lower precedence than “<“, “>”, “<=”, “>=”, “=”, and “<>”

Revision as of 06:20, 5 May 2023

The precedence order for the operations, starting with the highest precedence, in OCL is:

  • dot and arrow operations: “.” and “->”
  • unary “not” and unary minus
  • “*” and “/”
  • “+” and binary “-”
  • “if-then-else-endif”
  • “and”, “or,” and “xor”
  • “implies”
  • “<“, “>”, “<=”, “>=”
  • “=”, “<>”

Parentheses “(“ and “)” can be used to change precedence.

Note! This is not exactly according to the current OCL standard. In standard OCL, “and”, “or”, “xor” and “implies” have lower precedence than “<“, “>”, “<=”, “>=”, “=”, and “<>”

This page was edited 54 days ago on 03/19/2024. What links here