Package pascal.taie.ir.stmt
Class TableSwitch
java.lang.Object
pascal.taie.ir.stmt.JumpStmt
pascal.taie.ir.stmt.SwitchStmt
pascal.taie.ir.stmt.TableSwitch
- All Implemented Interfaces:
Serializable
,Stmt
,Indexable
- See Also:
-
Field Summary
Fields inherited from class pascal.taie.ir.stmt.SwitchStmt
defaultTarget, targets, var
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T> T
accept
(StmtVisitor<T> visitor) getDef()
int
int
getIndex()
int
int
void
setIndex
(int index) void
setLineNumber
(int lineNumber) Methods inherited from class pascal.taie.ir.stmt.SwitchStmt
canFallThrough, getDefaultTarget, getTarget, getTargets, getUses, getVar, setDefaultTarget, setTargets, toString
-
Field Details
-
index
protected int index -
lineNumber
protected int lineNumber
-
-
Constructor Details
-
TableSwitch
-
-
Method Details
-
getLowIndex
public int getLowIndex() -
getHighIndex
public int getHighIndex() -
getCaseValues
- Specified by:
getCaseValues
in classSwitchStmt
- Returns:
- all case values of the switch statement. For example,
for switch statement
switch (x) { case 1: a = 1; break; case 3: a = 3; break; default: a = 0; break; }
This API would return [1, 3].
-
getCaseTargets
- Specified by:
getCaseTargets
in classSwitchStmt
- Returns:
- pairs of case value and the corresponding jump target.
Default case is excluded. For example, for switch statement
switch (x) { case 1: a = 1; break; case 3: a = 3; break; default: a = 0; break; }
This API would return [(1, a = 1;), (3, a = 3;)].
-
accept
-
getInsnString
- Specified by:
getInsnString
in classSwitchStmt
-
getIndex
public int getIndex() -
setIndex
public void setIndex(int index) -
getLineNumber
public int getLineNumber()- Specified by:
getLineNumber
in interfaceStmt
- Returns:
- the line number of this Stmt in the original source file. If the line number is unavailable, return -1.
-
setLineNumber
public void setLineNumber(int lineNumber) - Specified by:
setLineNumber
in interfaceStmt
-
getDef
-