|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--harpoon.ClassFile.HCode | +--harpoon.IR.Tree.Code
Tree.Code
is an abstract superclass of codeviews
using the components in IR.Tree
. It implements
shared methods for the various codeviews using Tree
s.
Nested Class Summary | |
class |
Code.TreeFactory
Create a proper TreeFactory. |
Nested classes inherited from class harpoon.ClassFile.HCode |
HCode.PrintCallback |
Field Summary | |
protected Frame |
frame
The Frame containing machine-specific information |
protected HMethod |
parent
The method that this code view represents. |
protected Code.TreeFactory |
tf
Tree factory. |
protected Tree |
tree
The Tree Objects composing this code view. |
Constructor Summary | |
protected |
Code(HMethod parent,
Tree tree,
Frame frame)
constructor. |
Method Summary | |
HCodeAndMaps |
clone(HMethod newMethod)
Clone this code representation. |
abstract HCodeAndMaps |
clone(HMethod newMethod,
Frame frame)
Clone this code representation. |
protected HCodeAndMaps |
cloneHelper(Code tc,
DerivationGenerator dg)
Helps to create a proper HCodeAndMaps during cloning |
ArrayFactory |
elementArrayFactory()
Return an ArrayFactory for the HCodeElement s
composing this HCode . |
HCodeElement[] |
getElements()
Returns an ordered list of the Tree Objects
making up this code view. |
Iterator |
getElementsI()
Returns an Iterator of the Tree Objects
making up this code view. |
Frame |
getFrame()
|
CFGrapher |
getGrapher()
Returns a means to externally associate control flow with this tree code. |
HCodeElement[] |
getLeafElements()
Returns the leaves of the Tree |
HMethod |
getMethod()
Return the HMethod this codeview
belongs to. |
abstract String |
getName()
Return the name of this code view. |
HCodeElement |
getRootElement()
Returns the root of the Tree |
abstract TreeDerivation |
getTreeDerivation()
|
UseDefer |
getUseDefer()
Returns a means to externally associate use/def information with this tree code. |
abstract boolean |
isCanonical()
Returns true if this codeview is a canonical representation |
void |
print(PrintWriter pw,
HCode.PrintCallback callback)
Pretty-print this code view using the specified callback. |
void |
remove(Stm stm)
Removes the specified Stm from the tree in which it
resides. |
Methods inherited from class harpoon.ClassFile.HCode |
clone, elementIndexer, getElementsE, getElementsL, print, toString |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected Tree tree
protected Frame frame
protected Code.TreeFactory tf
protected HMethod parent
Constructor Detail |
protected Code(HMethod parent, Tree tree, Frame frame)
Method Detail |
public abstract HCodeAndMaps clone(HMethod newMethod, Frame frame)
protected final HCodeAndMaps cloneHelper(Code tc, DerivationGenerator dg)
HCodeAndMaps
during cloning
public final HCodeAndMaps clone(HMethod newMethod)
clone
in class HCode
public CFGrapher getGrapher()
getGrapher()
, the grapher is invalid, this method
should be re-invoked to acquire a new grapher.
public UseDefer getUseDefer()
kids()
method are considered uses. Not
valid for non-canonical forms.
public abstract String getName()
getName
in class HCode
public HMethod getMethod()
HMethod
this codeview
belongs to.
getMethod
in class HCode
public Frame getFrame()
public abstract TreeDerivation getTreeDerivation()
public HCodeElement getRootElement()
getRootElement
in class HCode
null
if this notion
is not applicable.public HCodeElement[] getLeafElements()
getLeafElements
in class HCode
null
if this notion
is not applicable.public HCodeElement[] getElements()
Tree
Objects
making up this code view. The root of the tree
is in element 0 of the array.
getElements
in class HCode
Instr
public Iterator getElementsI()
Iterator
of the Tree
Objects
making up this code view. The root of the tree is the first element
of the Iterator. Returns the elements of the tree in depth-first
pre-order.
getElementsI
in class HCode
public ArrayFactory elementArrayFactory()
HCode
ArrayFactory
for the HCodeElement
s
composing this HCode
.
elementArrayFactory
in class HCode
public void print(PrintWriter pw, HCode.PrintCallback callback)
HCode
print
in class HCode
public abstract boolean isCanonical()
public void remove(Stm stm)
Stm
from the tree in which it
resides.
stm
is not of type SEQ
.
stm.getParent()
must be of type SEQ
.
stm
is an element of this codeview.
stm
is not the root element of this codeview.
stm
from this tree.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |