public abstract class Node
extends java.lang.Object
| Constructor and Description |
|---|
Node()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Block |
block()
Returns the basic block in which this Node resides.
|
void |
cleanup()
Cleans up this node so that it is independent of the expression tree in
which it resides.
|
abstract void |
cleanupOnly()
Clean up this Node only.
|
protected Node |
copyInto(Node node)
Copies the contents of one Node into another.
|
boolean |
hasParent() |
int |
key()
A Node's key represents an integer value that can be used by an algorithm
to mark this node.
|
Node |
parent() |
void |
replaceWith(Node node)
Replaces this node with another and perform cleanup.
|
void |
replaceWith(Node node,
boolean cleanup)
Replaces this Node with node in its (this's) tree.
|
void |
setKey(int key) |
void |
setParent(Node parent)
Sets the parent Node of this Node.
|
void |
setValueNumber(int valueNumber)
Sets this Node's value number.
|
java.lang.String |
toString() |
int |
valueNumber()
Returns this Node's value number.
|
abstract void |
visit(TreeVisitor visitor) |
void |
visitChildren(TreeVisitor visitor) |
abstract void |
visitForceChildren(TreeVisitor visitor)
Visit the children of this node.
|
void |
visitOnly(TreeVisitor visitor) |
protected Node parent
public int valueNumber()
public void setValueNumber(int valueNumber)
public int key()
public void setKey(int key)
public abstract void visitForceChildren(TreeVisitor visitor)
public abstract void visit(TreeVisitor visitor)
public void visitChildren(TreeVisitor visitor)
public void visitOnly(TreeVisitor visitor)
public Block block()
public void setParent(Node parent)
public boolean hasParent()
public Node parent()
protected Node copyInto(Node node)
node - A Node from which to copy.public abstract void cleanupOnly()
public void cleanup()
Traverse the Tree starting at this Node. Remove the parent of each node and perform any Node-specific cleanup (see cleanupOnly). Sets various pointers to null so that they eventually may be garbage collected.
public void replaceWith(Node node)
public void replaceWith(Node node, boolean cleanup)
node - The Node with which to replace.cleanup - Do we perform cleanup on the tree?public java.lang.String toString()
toString in class java.lang.Object