Package pascal.taie.ir.stmt
Class LookupSwitch
java.lang.Object
pascal.taie.ir.stmt.JumpStmt
pascal.taie.ir.stmt.SwitchStmt
pascal.taie.ir.stmt.LookupSwitch
- 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) int
getCaseValue
(int index) getDef()
int
getIndex()
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
-
LookupSwitch
-
-
Method Details
-
getCaseValue
public int getCaseValue(int index) -
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
-