for information about XES schema see these
pages.
BinaryOp
The binaryOp node is used to represent an operation on two operands which may
be intergers, floating point , boolean or string.
Binary Operation contains two elements plus an operation to be performed on
them, The operation is represented by a simple type and this node must contain
the 2 elements to be combined, the left hand and right hand operands. In addition
any number of comments can be added.
Attributes used
operator must be set to one of || , && , | , ^ , & , == , != ,
< , > , <= , >= , << , >> , >>> , + , - , *
, / , %
Child Elements
There must be exactly two child elements, each one represents an operand (in
addition there can be any number of comment
nodes).
Each of the two operands can be either:
In XES the precedence of operations is determined by the way that the binaryOp
nodes are nested, so there is no need for explicit coding of brackets. However
when converting from XES to java we have to use brackets when required, this
is determined by the rules of precedence. Since this would be complicated to
implement, as a first stage it is good enough to always wrap inner operations
in brackets even though this may not always be necessary. Athough we should
not wrap the outer most operation in brackets.
| usage |
java example |
XES example |
| |
a = b || c ; |
<assign operator="=">
<variable name="a"/>
<binaryOp operator="||">
<variable name="b"/>
<variable name="c"/>
</binaryOp>
</assign> |
| |
a = b && c ; |
<assign operator="=">
<variable name="a"/>
<binaryOp operator="&&">
<variable name="b"/>
<variable name="c"/>
</binaryOp>
</assign> |
| |
a = b | c ; |
<assign operator="=">
<variable name="a"/>
<binaryOp operator="|">
<variable name="b"/>
<variable name="c"/>
</binaryOp>
</assign> |
| |
a = b ^ c ; |
<assign operator="=">
<variable name="a"/>
<binaryOp operator="^">
<variable name="b"/>
<variable name="c"/>
</binaryOp>
</assign> |
| |
a = b & c ; |
<assign operator="=">
<variable name="a"/>
<binaryOp operator="&">
<variable name="b"/>
<variable name="c"/>
</binaryOp>
</assign> |
| |
a = b == c ; |
<assign operator="=">
<variable name="a"/>
<binaryOp operator="==">
<variable name="b"/>
<variable name="c"/>
</binaryOp>
</assign> |
| |
a = b != c ; |
<assign operator="=">
<variable name="a"/>
<binaryOp operator="!=">
<variable name="b"/>
<variable name="c"/>
</binaryOp>
</assign> |
| |
a = b < c ; |
<assign operator="=">
<variable name="a"/>
<binaryOp operator="<">
<variable name="b"/>
<variable name="c"/>
</binaryOp>
</assign> |
| |
a = b > c ; |
<assign operator="=">
<variable name="a"/>
<binaryOp operator=">">
<variable name="b"/>
<variable name="c"/>
</binaryOp>
</assign> |
| |
a = b <= c ; |
<assign operator="=">
<variable name="a"/>
<binaryOp operator="<=">
<variable name="b"/>
<variable name="c"/>
</binaryOp>
</assign> |
| |
a = b >= c ; |
<assign operator="=">
<variable name="a"/>
<binaryOp operator=">=">
<variable name="b"/>
<variable name="c"/>
</binaryOp>
</assign> |
| |
a = b << c ; |
<assign operator="=">
<variable name="a"/>
<binaryOp operator="<<">
<variable name="b"/>
<variable name="c"/>
</binaryOp>
</assign> |
| |
a = b >> c ; |
<assign operator="=">
<variable name="a"/>
<binaryOp operator=">>">
<variable name="b"/>
<variable name="c"/>
</binaryOp>
</assign> |
| |
a = b >>> c ; |
<assign operator="=">
<variable name="a"/>
<binaryOp operator=">>>">
<variable name="b"/>
<variable name="c"/>
</binaryOp>
</assign> |
| |
a = b + c ; |
<assign operator="=">
<variable name="a"/>
<binaryOp operator="+">
<variable name="b"/>
<variable name="c"/>
</binaryOp>
</assign> |
| |
a = b - c ; |
<assign operator="=">
<variable name="a"/>
<binaryOp operator="-">
<variable name="b"/>
<variable name="c"/>
</binaryOp>
</assign> |
| |
a = b * c ; |
<assign operator="=">
<variable name="a"/>
<binaryOp operator="*">
<variable name="b"/>
<variable name="c"/>
</binaryOp>
</assign> |
| |
a = b / c ; |
<assign operator="=">
<variable name="a"/>
<binaryOp operator="/">
<variable name="b"/>
<variable name="c"/>
</binaryOp>
</assign> |
| |
a = b % c ; |
<assign operator="=">
<variable name="a"/>
<binaryOp operator="%">
<variable name="b"/>
<variable name="c"/>
</binaryOp>
</assign> |
| |
a = b + c * d; |
<assign operator="=">
<variable name="a"/>
<binaryOp operator="+">
<variable name="b"/>
<binaryOp operator="*">
<variable name="c"/>
<variable name="d"/>
</binaryOp>
</binaryOp>
</assign> |
| |
a = c * d + b; |
<assign operator="=">
<variable name="a"/>
<binaryOp operator="+">
<binaryOp operator="*">
<variable name="c"/>
<variable name="d"/>
</binaryOp>
<variable name="b"/>
</binaryOp>
</assign> |
| |
a = (b + c) * d; |
<assign operator="=">
<variable name="a"/>
<binaryOp operator="*">
<variable>
<binaryOp operator="+">
<variable name="b"/>
<variable name="c"/>
</binaryOp>
</variable>
<variable name="d"/>
</binaryOp>
</assign> |
| |
a = c * (d + b); |
<assign operator="=">
<variable name="a"/>
<binaryOp operator="*">
<variable name="c"/>
<variable>
<binaryOp operator="+">
<variable name="d"/>
<variable name="b"/>
</binaryOp>
</variable>
</binaryOp>
</assign> |
| |
|
|