The Operator type exposes the following members.
Fields
Name | Description | |
---|---|---|
ASSOCIATIVE |
Associative operators x*(y*z) == (x*y)*z .
|
|
BINARY |
Binary operators, such as x+y, x>y
|
|
COMMUTATIVE |
Commutative operators x*y = y*x.
|
|
COMPOSITE |
composite operators, like a-b which is a+(-b)
|
|
EQUIVALENCE |
Equivalence relations = reflexive, transitive and symmetric.
|
|
flags |
Flags for type of operator
|
|
LEFT |
Left binding like +: 1+2+3 -> (1+2)+3
|
|
NARY |
Trinary ops such as ?: and or higher like [x,y,z,w]
|
|
NO_ARGS |
No arguments to operator
|
|
NOT_IN_PARSER |
Non standard operators, like array access.
These will typically require the PrintRulesI interface to print
and require special parsing options.
|
|
PREFIX |
prefix operators -x
|
|
REFLEXIVE |
Reflective relations x=x for all x.
|
|
RIGHT |
Right binding like =: 1=2=3 -> 1=(2=3)
|
|
SELF_INVERSE |
self inverse operators like -(-x) !(!x)
|
|
SUFFIX |
postfix operators x%
|
|
SYMMETRIC |
Symmetric relation x=y implies y=x.
|
|
TERNARY |
three argument operators like java's cond?tval:fval
|
|
TRANSITIVE |
Transitive relations x=y and y=z implies x=z
|
|
UNARY |
Unary operators, such as -x !x ~x
|
|
USE_BINDING_FOR_PRINT |
For non commutative operators printing can be determined by the left or right binding.
For example (a-b)-c is printed as a-b-c (flag set).
But a/b/c could be ambiguous so (a/b)/c is printed with brackets (flag not set).
|