Class SwitchStmt
java.lang.Object
EDU.purdue.cs.bloat.tree.Node
EDU.purdue.cs.bloat.tree.Stmt
EDU.purdue.cs.bloat.tree.JumpStmt
EDU.purdue.cs.bloat.tree.SwitchStmt
SwitchStmt represents a switch statement.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionSwitchStmt(Expr index, Block defaultTarget, Block[] targets, int[] values) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionclone()index()voidsetDefaultTarget(Block block) Block[]targets()int[]values()voidvisit(TreeVisitor visitor) voidvisitForceChildren(TreeVisitor visitor) Visit the children of this node.Methods inherited from class JumpStmt
catchTargets, copyIntoMethods inherited from class Stmt
cleanupOnlyMethods inherited from class Node
block, cleanup, hasParent, key, parent, replaceWith, replaceWith, setKey, setParent, setValueNumber, toString, valueNumber, visitChildren, visitOnly
-
Constructor Details
-
SwitchStmt
Constructor.- Parameters:
index- The expression on which the switch is made.defaultTarget- The code to be executed if index is not contained in values.targets- The code to be executed for each value in values.values- The interesting values that index can have. That is, the values of index in which a non-default target is executed.
-
-
Method Details
-
index
-
setDefaultTarget
-
defaultTarget
-
targets
-
values
public int[] values() -
visitForceChildren
Description copied from class:NodeVisit the children of this node. Not all Nodes will have children to visit.- Specified by:
visitForceChildrenin classNode
-
visit
-
clone
-