OCL Precedence rules
(Adding template at the end of the page)
No edit summary
 
Line 13: Line 13:
'''Note!''' This is not exactly according to the current OCL standard. In standard OCL, ''“and”'', ''“or”'', ''“xor”'' and ''“implies”'' have lower precedence than <code>“<“</code>, <code>“>”</code>, <code>“<=”</code>, <code>“>=”</code>, <code>“=”</code>, and <code>“<>”</code>
'''Note!''' This is not exactly according to the current OCL standard. In standard OCL, ''“and”'', ''“or”'', ''“xor”'' and ''“implies”'' have lower precedence than <code>“<“</code>, <code>“>”</code>, <code>“<=”</code>, <code>“>=”</code>, <code>“=”</code>, and <code>“<>”</code>
{{Edited|July|12|2024}}
{{Edited|July|12|2024}}
[[Category:OCL]]

Latest revision as of 05:37, 19 March 2024

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