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 booleancheckOperatorType(COperatorType optype) Deep duplication of the element.intGet the first operand, never null.default COperatorTypeGet the second operand, might be null.Get the third operand, might be null.booleanMirror the operation order, whenever possible.booleanLogical negation of the operation, whenever possible.voidvoidvoidsetOperator(ICOperator operator) Set the operator for the expression.voidvoidMethods 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() -
getOperands
List<ICExpression> getOperands() -
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-
-
getExtraOperands
List<ICExpression> getExtraOperands()- Returns:
-
setExtraOperands
- Parameters:
l-
-
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:ICElementDeep duplication of the element. Sub-elements are duplicated.Note:
ICClass,ICMethod,ICField,ICIdentifier,ICConstant,ICTypeandICLabelare not duplicated.- Specified by:
duplicatein interfaceICElement- Specified by:
duplicatein interfaceICExpression- Specified by:
duplicatein interfaceICLeftExpression
-