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 *...")
 
m ((username removed) (log details removed))
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
The precedence order for the operations, starting with highest precedence, in OCL is:
<message>Write the content here to display this box</message>
* 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 current OCL standard. In standard OCL, “and”, “or,”, “xor” and “implies” has lower precedence than “<“, “>”, “<=”, “>=”, “=”, “<>”
The precedence order for the operations, starting with the highest precedence, in OCL is:
* dot and arrow operations: <code><span class="col-black">“.”</span></code> and <code><span class="col-black">“->”</span></code>
* unary ''“not”'' and unary ''minus''
* <code><span class="col-black">“*”</span></code> and <code><span class="col-black">“/”</span></code>
* <code><span class="col-black">“+”</span></code> and binary <code><span class="col-black">“-”</span></code>
* ''“if-then-else-endif”''
* <code><span class="col-black">“and”</span></code>, <code><span class="col-black">“or”</span></code>, and <code><span class="col-black">“xor”</span></code>
* ''“implies”''
* <code><span class="col-black">“<“</span></code>, <code><span class="col-black">“>”</span></code>, <code><span class="col-black">“<=”</span></code>, <code><span class="col-black">“>=”</span></code>
* <code><span class="col-black">“=”</span></code>, <code><span class="col-black">“<>”</span></code>
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 <code><span class="col-black">“<“</span></code>, <code><span class="col-black">“>”</span></code>, <code><span class="col-black">“<=”</span></code>, <code><span class="col-black">“>=”</span></code>, <code><span class="col-black">“=”</span></code>, and <code><span class="col-black">“<>”</span></code>
{{Edited|July|12|2024}}
[[Category:OCL]]

Latest revision as of 05:48, 19 June 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 93 days ago on 06/19/2024. What links here