harpoon.IR.Tree
Class SEQ

java.lang.Object
  extended by harpoon.IR.Tree.Tree
      extended by harpoon.IR.Tree.Stm
          extended by harpoon.IR.Tree.SEQ
All Implemented Interfaces:
HCodeElement, HDataElement

public class SEQ
extends Stm
implements HDataElement

SEQ evaluates the left statement followed by the right statement.

Version:
$Id: SEQ.java,v 1.7 2003/06/04 15:45:47 salcianu 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
 
Fields inherited from class harpoon.IR.Tree.Tree
arrayFactory, child
 
Constructor Summary
SEQ(Stm left, Stm right)
          Convenient constructor: the tree factory and the source arguments are identical to those for the left and the right statements (those statements must have the same tree factory and source).
SEQ(TreeFactory tf, HCodeElement source, Stm left, Stm right)
          Constructor.
 
Method Summary
 void accept(TreeVisitor v)
          Accept a visitor
 Stm build(TreeFactory tf, ExpList kids)
           
 Stm getLeft()
          Returns the statement to evaluate first.
 Stm getRight()
          Returns the statement to evaluate last.
 ExpList kids()
          Return a list of subexpressions of this Tree.
 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 setLeft(Stm left)
          Sets the statement to evaluate first.
 void setRight(Stm right)
          Sets the statement to evaluate last.
 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, rename, replace, setChild, unlink
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface harpoon.ClassFile.HDataElement
getID, getSourceFile
 

Constructor Detail

SEQ

public SEQ(TreeFactory tf,
           HCodeElement source,
           Stm left,
           Stm right)
Constructor.


SEQ

public SEQ(Stm left,
           Stm right)
Convenient constructor: the tree factory and the source arguments are identical to those for the left and the right statements (those statements must have the same tree factory and source).

Parameters:
left - Statement executed first
right - Statement executed second
Method Detail

getLeft

public Stm getLeft()
Returns the statement to evaluate first.


getRight

public Stm getRight()
Returns the statement to evaluate last.


setLeft

public void setLeft(Stm left)
Sets the statement to evaluate first.


setRight

public void setRight(Stm right)
Sets the statement to evaluate last.


kids

public ExpList kids()
Description copied from class: Tree
Return a list of subexpressions of this Tree.

Overrides:
kids in class Tree

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