public interface

ICIfStm

implements ICConditionalStatement
com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.ICIfStm

Class Overview

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
 

Summary

Public Methods
abstract void addBranch(ICPredicate p, ICBlock b)
Add an alternative block (if or else-if) to this element.
abstract ICIfStm duplicate()
Deep duplication of the element.
abstract ICBlock getBranchBody(int index)
abstract ICPredicate getBranchPredicate(int index)
abstract List<? extends ICPredicate> getBranchPredicates()
Get the predicates.
abstract void insertBranch(int index, ICPredicate p, ICBlock b)
abstract void removeBranch(int index)
abstract ICBlock removeDefaultBlock()
Remove the default block, if there one, and return it.
abstract void setBranchBody(int index, ICBlock b)
abstract void setBranchPredicate(int index, ICPredicate p)
abstract void setDefaultBlock(ICBlock b)
Set the default block of code.
[Expand]
Inherited Methods
From interface com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.ICCompound
From interface com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.ICConditionalStatement
From interface com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.ICElement
From interface com.pnfsoftware.jeb.core.units.code.asm.decompiler.ast.ICStatement

Public Methods

public abstract void addBranch (ICPredicate p, ICBlock b)

Add an alternative block (if or else-if) to this element.

Parameters
p mandatory predicate
b mandatory statement

public abstract ICIfStm duplicate ()

Deep duplication of the element. Sub-elements are duplicated.

Note: ICClass, ICMethod, ICField, ICIdentifier, ICConstant, ICType and ICLabel are not duplicated.

public abstract ICBlock getBranchBody (int index)

public abstract ICPredicate getBranchPredicate (int index)

public abstract 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

public abstract void insertBranch (int index, ICPredicate p, ICBlock b)

public abstract void removeBranch (int index)

public abstract ICBlock removeDefaultBlock ()

Remove the default block, if there one, and return it.

Returns
  • the default block (null if there was none)

public abstract void setBranchBody (int index, ICBlock b)

public abstract void setBranchPredicate (int index, ICPredicate p)

public abstract void setDefaultBlock (ICBlock b)

Set the default block of code.

Parameters
b optional block, set to null to remove the default block