Interface ICOperator
This interface is used to define a C operator.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault booleancheckType(COperatorType... candidateTypes) Get the associativity (left, right) of the operator.intintGet the precedence of the operator.intgetPrecedenceDelta(ICOperator other) Check the precedence of this operator against another operator.getType()booleanisBinary()booleanisCast()booleanisCustom()booleanbooleanbooleanisUnary()booleanDetermine if this operator is one of the 11 (+1) arithmetic operators that can be used to build a combined-operator assignment.
-
Field Details
-
OP_ROR
- See Also:
-
OP_ROL
- See Also:
-
OP_POW
- See Also:
-
OP_CARRY
- See Also:
-
OP_PARITY
- See Also:
-
-
Method Details
-
getType
COperatorType getType() -
checkType
-
isRegular
boolean isRegular() -
isCustom
boolean isCustom() -
isCast
boolean isCast() -
getCastType
ICType getCastType() -
getOperandCount
int getOperandCount() -
isUnary
boolean isUnary() -
isBinary
boolean isBinary() -
isTertiary
boolean isTertiary() -
isValidForCombinedAssignment
boolean isValidForCombinedAssignment()Determine if this operator is one of the 11 (+1) arithmetic operators that can be used to build a combined-operator assignment.- Returns:
- true if one of: mul, div, add, sub, rem, shl, shr, ushr, and, xor, or
-
getPrecedenceDelta
Check the precedence of this operator against another operator.- Returns:
- delta: <0 if this operator has higher precedence than other, 0 if their precedence is the same, or >0 if this operator has lower precedence than other.
- Throws:
Exception
-
getPrecedence
int getPrecedence()Get the precedence of the operator. Currently not implemented for all operators, and the method will throw if it cannot find a precedence value.- Returns:
- Throws:
RuntimeException- if the precedence is not found
-
getAssociativity
COperatorType.Associativity getAssociativity()Get the associativity (left, right) of the operator.- Returns:
- Throws:
RuntimeException- if the associativity is not found
-
getReverse
ICOperator getReverse() -
getMirror
ICOperator getMirror()
-