harpoon.IR.Tree
Class THROW

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

public class THROW
extends Stm
implements Typed

THROW objects are used to represent a thrown exception.

Version:
$Id: THROW.java,v 1.4 2002/04/10 03:05:45 cananian Exp $
Author:
Duncan Bryce <duncan@lcs.mit.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
 
Fields inherited from interface harpoon.IR.Tree.Typed
DOUBLE, FLOAT, INT, LONG, POINTER
 
Constructor Summary
THROW(TreeFactory tf, HCodeElement source, Exp retex, Exp handler)
          Constructor
 
Method Summary
 void accept(TreeVisitor v)
          Accept a visitor
 Stm build(TreeFactory tf, ExpList kids)
           
 Exp getHandler()
          The location of the exception-handling code
 Exp getRetex()
          The exceptional value to return
 boolean isDoubleWord()
          Returns true if the expression corresponds to a 64-bit value.
 boolean isFloatingPoint()
          Returns true if the expression corresponds to a floating-point value.
 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 setHandler(Exp handler)
          Set the location of the exception-handling code
 void setRetex(Exp retex)
          Set the exceptional value to return
 String toString()
           
 int type()
          Returns enumerated constant (INT, LONG, FLOAT, DOUBLE, or POINTER) corresponding to the type of the expression.
 
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
 

Constructor Detail

THROW

public THROW(TreeFactory tf,
             HCodeElement source,
             Exp retex,
             Exp handler)
Constructor

Parameters:
retex - the exceptional value to return
handler - the location of the exception-handling code to branch to
Method Detail

getRetex

public Exp getRetex()
The exceptional value to return


getHandler

public Exp getHandler()
The location of the exception-handling code


setRetex

public void setRetex(Exp retex)
Set the exceptional value to return


setHandler

public void setHandler(Exp handler)
Set the location of the exception-handling code


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

type

public int type()
Description copied from interface: Typed
Returns enumerated constant (INT, LONG, FLOAT, DOUBLE, or POINTER) corresponding to the type of the expression.

Specified by:
type in interface Typed
Returns:
Type.POINTER

isDoubleWord

public boolean isDoubleWord()
Description copied from interface: Typed
Returns true if the expression corresponds to a 64-bit value.

Specified by:
isDoubleWord in interface Typed

isFloatingPoint

public boolean isFloatingPoint()
Description copied from interface: Typed
Returns true if the expression corresponds to a floating-point value.

Specified by:
isFloatingPoint in interface Typed

toString

public String toString()
Overrides:
toString in class Object