Package EDU.purdue.cs.bloat.tree
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
-
public class SwitchStmt extends JumpStmt
SwitchStmt represents a switch statement.
-
-
Constructor Summary
Constructors Constructor Description SwitchStmt(Expr index, Block defaultTarget, Block[] targets, int[] values)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()BlockdefaultTarget()Exprindex()voidsetDefaultTarget(Block block)Block[]targets()int[]values()voidvisit(TreeVisitor visitor)voidvisitForceChildren(TreeVisitor visitor)Visit the children of this node.-
Methods inherited from class EDU.purdue.cs.bloat.tree.JumpStmt
catchTargets, copyInto
-
Methods inherited from class EDU.purdue.cs.bloat.tree.Stmt
cleanupOnly
-
Methods inherited from class EDU.purdue.cs.bloat.tree.Node
block, cleanup, hasParent, key, parent, replaceWith, replaceWith, setKey, setParent, setValueNumber, toString, valueNumber, visitChildren, visitOnly
-
-
-
-
Constructor Detail
-
SwitchStmt
public SwitchStmt(Expr index, Block defaultTarget, Block[] targets, int[] values)
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 Detail
-
index
public Expr index()
-
setDefaultTarget
public void setDefaultTarget(Block block)
-
defaultTarget
public Block defaultTarget()
-
targets
public Block[] targets()
-
values
public int[] values()
-
visitForceChildren
public void visitForceChildren(TreeVisitor visitor)
Description copied from class:NodeVisit the children of this node. Not all Nodes will have children to visit.- Specified by:
visitForceChildrenin classNode
-
visit
public void visit(TreeVisitor visitor)
-
-