Package EDU.purdue.cs.bloat.tree
Class IfZeroStmt
- 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.IfStmt
-
- EDU.purdue.cs.bloat.tree.IfZeroStmt
-
public class IfZeroStmt extends IfStmt
IfZeroStmt evaluates an expression and executes one of its two branches depending on whether or not the expression evaluated to zero.
-
-
Constructor Summary
Constructors Constructor Description IfZeroStmt(int comparison, Expr expr, Block trueTarget, Block falseTarget)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()Exprexpr()voidvisit(TreeVisitor visitor)voidvisitForceChildren(TreeVisitor visitor)Visit the children of this node.-
Methods inherited from class EDU.purdue.cs.bloat.tree.IfStmt
comparison, falseTarget, negate, setFalseTarget, setTrueTarget, trueTarget
-
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
-
IfZeroStmt
public IfZeroStmt(int comparison, Expr expr, Block trueTarget, Block falseTarget)Constructor.- Parameters:
comparison- Comparison operator.expr- An expression to be evaluated.trueTarget- Basic Block that is executed if the expression evaluates to zero.falseTarget- Basic Block that is executed if the expression evaluates to non-zero.
-
-
Method Detail
-
expr
public Expr expr()
- Returns:
- The expression that is evaluated.
-
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)
-
-