Interface ICOperation
- All Superinterfaces:
ICElement
,ICExpression
,ICLeftExpression
C AST interface to represent arithmetic and logical expressions.
An expression consists of one or two members (the left and right members) and an operator. The left member is optional, and should be null for unary operators.
A third member may be specified for ternary expressions
.
Examples:
a + 1 a * ((int)b - foo()) !x x ^ y | z c ? a: b
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
checkOperatorType
(COperatorType optype) Deep duplication of the element.int
Get the first operand, never null.default COperatorType
Get the second operand, might be null.Get the third operand, might be null.boolean
Mirror the operation order, whenever possible.boolean
Logical negation of the operation, whenever possible.void
void
setOperator
(ICOperator operator) Set the operator for the expression.void
void
Methods inherited from interface com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.ICElement
addPhysicalOffset, addPhysicalOffsets, evaluate, format, generate, getData, getElementType, getPhysicalOffset, getPhysicalOffsets, getSubElements, replaceSubElement, setData, setPhysicalOffsets, toString, visitDepthPost, visitDepthPost, visitDepthPost, visitDepthPre, visitDepthPre, visitDepthPre
-
Method Details
-
getOperator
ICOperator getOperator() -
setOperator
Set the operator for the expression. Dangerous method! the operator type is not checked, it is the caller's responsibility to do so.- Parameters:
operator
- operator, cannot be null
-
getOperatorType
-
checkOperatorType
-
getCountOfOperands
int getCountOfOperands() -
getFirstOperand
ICExpression getFirstOperand()Get the first operand, never null. -
setFirstOperand
- Parameters:
e
-
-
getSecondOperand
ICExpression getSecondOperand()Get the second operand, might be null. -
setSecondOperand
- Parameters:
e
-
-
getThirdOperand
ICExpression getThirdOperand()Get the third operand, might be null. -
setThirdOperand
- Parameters:
e
-
-
reverse
Logical negation of the operation, whenever possible. The object is modified.- Parameters:
of
-- Returns:
- true if reversing was possible, false otherwise
-
mirror
Mirror the operation order, whenever possible. The object is modified.- Parameters:
of
-- Returns:
- true if mirroring was possible, false otherwise
-
duplicate
ICOperation duplicate()Description copied from interface:ICElement
Deep duplication of the element. Sub-elements are duplicated.Note:
ICClass
,ICMethod
,ICField
,ICIdentifier
,ICConstant
,ICType
andICLabel
are not duplicated.- Specified by:
duplicate
in interfaceICElement
- Specified by:
duplicate
in interfaceICExpression
- Specified by:
duplicate
in interfaceICLeftExpression
-