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 TypeMethodDescriptionvoidaddBranch(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.voidinsertBranch(int index, ICPredicate p, ICBlock b) voidremoveBranch(int index) default ICBlockRemove the default block, if there one, and return it.voidsetBranchBody(int index, ICBlock b) voidsetBranchPredicate(int index, ICPredicate p) voidSet the default block of code.Methods inherited from interface com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.ICCompound
generateFlatList, insertAt, resetMethods inherited from interface com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.ICConditionalStatement
getBlocks, getConditionalBlocks, getDefaultBlock, hasDefaultBlock, size, sizeWithoutDefaultMethods 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
-
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:ICConditionalStatementSet the default block of code.- Specified by:
setDefaultBlockin 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:ICElementDeep duplication of the element. Sub-elements are duplicated.Note:
ICClass,ICMethod,ICField,ICIdentifier,ICConstant,ICTypeandICLabelare not duplicated.- Specified by:
duplicatein interfaceICCompound- Specified by:
duplicatein interfaceICConditionalStatement- Specified by:
duplicatein interfaceICElement- Specified by:
duplicatein interfaceICStatement
-