harpoon.IR.Tree
Class CJUMP

java.lang.Object
  extended by harpoon.IR.Tree.Tree
      extended by harpoon.IR.Tree.Stm
          extended by harpoon.IR.Tree.CJUMP
All Implemented Interfaces:
HCodeElement

public class CJUMP
extends Stm

CJUMP objects are statements which stand for conditional branches.

Version:
$Id: CJUMP.java,v 1.4 2002/04/10 03:05:39 cananian Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>, based on Modern Compiler Implementation in Java by Andrew Appel.

Nested Class Summary
 
Nested classes/interfaces inherited from class harpoon.IR.Tree.Tree
Tree.CloneCallback
 
Field Summary
 Label iffalse
          The label to jump to if test is false.
 Label iftrue
          The label to jump to if test is true.
 
Fields inherited from class harpoon.IR.Tree.Tree
arrayFactory, child
 
Constructor Summary
CJUMP(TreeFactory tf, HCodeElement source, Exp test, Label iftrue, Label iffalse)
          Constructor.
 
Method Summary
 void accept(TreeVisitor v)
          Accept a visitor
 Stm build(TreeFactory tf, ExpList kids)
           
 Exp getTest()
          Returns the test condition for this CJUMP.
 int kind()
          Return an integer enumeration of the kind of this Tree.
 Tree rename(TreeFactory tf, TempMap tm, Tree.CloneCallback cb)
          Rename while cloning a subtree.
 void setTest(Exp test)
          Returns the test condition for this CJUMP.
 String toString()
           
 
Methods inherited from class harpoon.IR.Tree.Stm
build, isNop, linearize, toStm
 
Methods inherited from class harpoon.IR.Tree.Tree
clone, clone, getChild, getFactory, getFirstChild, getID, getLineNumber, getParent, getSibling, getSourceFile, hashCode, kids, rename, replace, setChild, unlink
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

iftrue

public final Label iftrue
The label to jump to if test is true.


iffalse

public final Label iffalse
The label to jump to if test is false.

Constructor Detail

CJUMP

public CJUMP(TreeFactory tf,
             HCodeElement source,
             Exp test,
             Label iftrue,
             Label iffalse)
Constructor.

Method Detail

getTest

public Exp getTest()
Returns the test condition for this CJUMP. The expression should evaluate into a boolean result.


setTest

public void setTest(Exp test)
Returns the test condition for this CJUMP. The given expression should evaluate into a boolean result.


kind

public int kind()
Description copied from class: Tree
Return an integer enumeration of the kind of this Tree. The enumerated values are defined in TreeKind.

Specified by:
kind in class Tree

build

public Stm build(TreeFactory tf,
                 ExpList kids)
Specified by:
build in class Stm

accept

public void accept(TreeVisitor v)
Accept a visitor

Specified by:
accept in class Tree

rename

public Tree rename(TreeFactory tf,
                   TempMap tm,
                   Tree.CloneCallback cb)
Description copied from class: Tree
Rename while cloning a subtree. This node and all child nodes are cloned; the 'temp' information of all TEMP nodes are renamed according to the supplied TempMap. Note that Temps not belonging to this.getFactory().tempFactory() are not affected. The callback() method of the supplied CloneCallback is invoked once on each subtree cloned, starting from the leaves and working back to the root in a post-order depth-first manner.

Specified by:
rename in class Tree

toString

public String toString()
Overrides:
toString in class Object