Interface ICIfStm
- All Superinterfaces:
ICCompound
,ICConditionalStatement
,ICElement
,ICStatement
C AST interface to represent a conditional "if" statement.
An if-statement consists of one or more branches (if, else-if) followed by an optional default branch (else) block.
Example:
if(p) b else if(p1) b1 else b2
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addBranch
(ICPredicate p, ICBlock b) Add an alternative block (if or else-if) to this element.Deep duplication of the element.getBranchBody
(int index) getBranchPredicate
(int index) List<? extends ICPredicate>
Get the predicates.void
insertBranch
(int index, ICPredicate p, ICBlock b) void
removeBranch
(int index) default ICBlock
Remove the default block, if there one, and return it.void
setBranchBody
(int index, ICBlock b) void
setBranchPredicate
(int index, ICPredicate p) void
Set the default block of code.Methods inherited from interface com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.ICCompound
generateFlatList, insertAt, reset
Methods inherited from interface com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.ICConditionalStatement
getBlocks, getConditionalBlocks, getDefaultBlock, hasDefaultBlock, size, sizeWithoutDefault
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
Methods inherited from interface com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.ICStatement
getIntermediateOffset, setIntermediateOffset
-
Method Details
-
getBranchPredicates
List<? extends ICPredicate> getBranchPredicates()Get the predicates. Warning, this is the actual list of predicates, not a copy. Caution should be exercised when modifying it- Returns:
- the original list of predicates
-
getBranchPredicate
-
setBranchPredicate
-
getBranchBody
-
setBranchBody
-
addBranch
Add an alternative block (if or else-if) to this element.- Parameters:
p
- mandatory predicateb
- mandatory statement
-
insertBranch
-
removeBranch
void removeBranch(int index) -
setDefaultBlock
Description copied from interface:ICConditionalStatement
Set the default block of code.- Specified by:
setDefaultBlock
in interfaceICConditionalStatement
- Parameters:
b
- optional block, set to null to remove the default block
-
removeDefaultBlock
Remove the default block, if there one, and return it.- Returns:
- the default block (null if there was none)
-
duplicate
ICIfStm 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 interfaceICCompound
- Specified by:
duplicate
in interfaceICConditionalStatement
- Specified by:
duplicate
in interfaceICElement
- Specified by:
duplicate
in interfaceICStatement
-