harpoon.IR.Tree
Class UNOP
java.lang.Object
harpoon.IR.Tree.Tree
harpoon.IR.Tree.Exp
harpoon.IR.Tree.OPER
harpoon.IR.Tree.UNOP
- All Implemented Interfaces:
- HCodeElement, Typed
public class UNOP
- extends OPER
UNOP
objects are expressions which stand for result of
applying some unary operator o to a subexpression.
- Version:
- $Id: UNOP.java,v 1.4 2002/04/10 03:05:46 cananian Exp $
- Author:
- C. Scott Ananian <cananian@alumni.princeton.edu>, based on
Modern Compiler Implementation in Java by Andrew Appel.
- See Also:
Uop
Methods inherited from class harpoon.IR.Tree.Tree |
clone, clone, getChild, getFactory, getFirstChild, getID, getLineNumber, getParent, getSibling, getSourceFile, hashCode, kids, rename, replace, setChild, unlink |
UNOP
public UNOP(TreeFactory tf,
HCodeElement source,
int optype,
int unop,
Exp operand)
- Constructor.
- Parameters:
unop
- Enumerated operation type, from Uop
.
getOperand
public Exp getOperand()
- Returns the subexpression to be operated upon.
setOperand
public void setOperand(Exp operand)
- Sets the subexpression to be operated upon.
type
public int type()
- Returns an
int
identifying the TYPE that this
unary operation returns.
- Specified by:
type
in interface Typed
- Specified by:
type
in class OPER
- See Also:
Uop
evalValue
public static Object evalValue(TreeFactory tf,
int op,
int optype,
Object left)
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 Exp build(TreeFactory tf,
ExpList kids)
- Specified by:
build
in class Exp
accept
public void accept(TreeVisitor v)
- Accept a visitor
- Overrides:
accept
in class OPER
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 Temp
s 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