Interface ICAssignment
- All Superinterfaces:
ICElement,ICSourceElement,ICStatement
C AST interface to represent assignments.
Example of a simple assignment:
left = right
A simple assignment can be modified to represent non-standard assignments:
- A combined-operator assignment
- A unary-operator assignment
-
Method Summary
Modifier and TypeMethodDescriptionDeep duplication of the element.duplicate(boolean omitDeclaration) Get the operator used for combined operator assignmentsgetLeft()Get the left-hand side of the assignment.getRight()Get the right-hand side of the assignment.voidgetUnaryOperator(boolean[] r) Get the operator used for a unary operator assignment.booleanCheck if the assignment is a combined operator assignment (+=, -=, ...).booleanCheck if the assignment is simple, i.e.booleanCheck if the assignment is a unary operator assignment (++, --).voidvoidsetCombinedOperatorAssignment(ICOperator op, ICExpression right) Set an extra operator, to transform the simple assignment (=) into one of the 11 allowed combined assignment operators.voidsetLeft(ICLeftExpression left) voidsetRight(ICExpression right) voidsetUnaryOperator(boolean increment, boolean prefix) 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, visitDepthPreMethods inherited from interface com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.ICStatement
getIntermediateOffset, setIntermediateOffset
-
Method Details
-
isSimpleAssignment
boolean isSimpleAssignment()Check if the assignment is simple, i.e. it is not a combined operator assignment and not a unary operator assignment. -
isCombinedOperatorAssignment
boolean isCombinedOperatorAssignment()Check if the assignment is a combined operator assignment (+=, -=, ...). -
getCombinedOperator
ICOperator getCombinedOperator()Get the operator used for combined operator assignments -
isUnaryOperatorAssignment
boolean isUnaryOperatorAssignment()Check if the assignment is a unary operator assignment (++, --). -
getUnaryOperator
void getUnaryOperator(boolean[] r) Get the operator used for a unary operator assignment.- Parameters:
r- will be filled with two values: r[0] is true for ++, false for --; r[1] is true for prefix ++/--, false for postfix ++/--
-
getLeft
ICLeftExpression getLeft()Get the left-hand side of the assignment. -
getRight
ICExpression getRight()Get the right-hand side of the assignment.Warning: null for unary operator assignments, and does not represent the final right value for combined operator assignments.
-
setLeft
-
setRight
- Throws:
IllegalStateException- if the assignment is a unary operator assignment
-
setCombinedOperatorAssignment
Set an extra operator, to transform the simple assignment (=) into one of the 11 allowed combined assignment operators.This operation is irreversible!
- Parameters:
op- non-null, can be: MUL, DIV, ADD, SUB, REM, SHL, SHR, USHR, AND, XOR, ORright- optional, updated right member of the assignment- Throws:
IllegalStateException- if the assignment is a unary operator assignment
-
setCombinedOperator
-
setUnaryOperator
void setUnaryOperator(boolean increment, boolean prefix) -
duplicate
ICAssignment 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 interfaceICSourceElement- Specified by:
duplicatein interfaceICStatement
-
duplicate
-