Class 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 Details

    • 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 Details

    • expr

      public Expr expr()
      Returns:
      The expression that is evaluated.
    • visitForceChildren

      public void visitForceChildren(TreeVisitor visitor)
      Description copied from class: Node
      Visit the children of this node. Not all Nodes will have children to visit.
      Specified by:
      visitForceChildren in class Node
    • visit

      public void visit(TreeVisitor visitor)
      Specified by:
      visit in class Node
    • clone

      public Object clone()
      Specified by:
      clone in class Stmt