|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectharpoon.ClassFile.HCode<Tree>
harpoon.IR.Tree.Code
public abstract class 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/interfaces inherited from class harpoon.ClassFile.HCode |
---|
HCode.PrintCallback<HCE extends HCodeElement> |
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<Tree> |
clone(HMethod newMethod)
Clone this code representation. |
abstract HCodeAndMaps<Tree> |
clone(HMethod newMethod,
Frame frame)
Clone this code representation. |
protected HCodeAndMaps<Tree> |
cloneHelper(Code tc,
DerivationGenerator dg)
Helps to create a proper HCodeAndMaps during cloning |
ArrayFactory<Tree> |
elementArrayFactory()
Return an ArrayFactory for the HCodeElement s
composing this HCode . |
Tree[] |
getElements()
Deprecated. |
Iterator<Tree> |
getElementsI()
Returns an Iterator of the Tree Objects
making up this code view. |
Frame |
getFrame()
|
CFGrapher<Tree> |
getGrapher()
Returns a means to externally associate control flow with this tree code. |
Tree[] |
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. |
Tree |
getRootElement()
Returns the root of the Tree |
abstract TreeDerivation |
getTreeDerivation()
|
UseDefer<Tree> |
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<Tree> 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, 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<Tree> clone(HMethod newMethod, Frame frame)
protected final HCodeAndMaps<Tree> cloneHelper(Code tc, DerivationGenerator dg)
HCodeAndMaps
during cloning
public final HCodeAndMaps<Tree> clone(HMethod newMethod)
clone
in class HCode<Tree>
public CFGrapher<Tree> getGrapher()
getGrapher()
, the grapher is invalid, this method
should be re-invoked to acquire a new grapher.
public UseDefer<Tree> getUseDefer()
kids()
method are considered uses. Not
valid for non-canonical forms.
public abstract String getName()
getName
in class HCode<Tree>
public HMethod getMethod()
HMethod
this codeview
belongs to.
getMethod
in class HCode<Tree>
public Frame getFrame()
public abstract TreeDerivation getTreeDerivation()
public Tree getRootElement()
getRootElement
in class HCode<Tree>
null
if this notion
is not applicable.public Tree[] getLeafElements()
getLeafElements
in class HCode<Tree>
null
if this notion
is not applicable.public Tree[] getElements()
Tree
Objects
making up this code view. The root of the tree
is in element 0 of the array.
getElements
in class HCode<Tree>
Instr
public Iterator<Tree> 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<Tree>
public ArrayFactory<Tree> elementArrayFactory()
HCode
ArrayFactory
for the HCodeElement
s
composing this HCode
.
elementArrayFactory
in class HCode<Tree>
public void print(PrintWriter pw, HCode.PrintCallback<Tree> callback)
HCode
print
in class HCode<Tree>
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 |