|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcoins.ir.IrListImpl
class IrListImpl List of expressions, symbols, and others. LinkedList in java.util is wrapped so that it can be treated as IR node and IR methods can be applied. This class may print messages to System.out instead of using put of Message because hirRoot/lirRoot might be null.
| Field Summary | |
protected HirAnnex |
fHirAnnex
|
protected int |
fOperator
|
protected IR |
fParent
|
HirRoot |
hirRoot
|
| Fields inherited from interface coins.ir.IR |
OP_CODE_NAME, OP_INF, OP_LIST, OP_PROG, OP_SUBP_DEF |
| Constructor Summary | |
IrListImpl(HirRoot pHirRoot)
|
|
IrListImpl(HirRoot pHirRoot,
java.util.LinkedList pList)
IrList constructor foe HIR Wrap pList so that it can be treated as IR node. |
|
| Method Summary | |
void |
add(int pInsertionPosition,
java.lang.Object pObjectToBeInserted)
|
void |
add(java.lang.Object pElement)
|
void |
addInf(java.lang.String pInfKindInterned,
java.lang.Object pInfObject)
addInf Add (attach) information pInfObject to this IR node. |
IR |
buildNode(int pOperator)
|
IR |
buildNode(int pOperator,
IR pSource1)
|
IR |
buildNode(int pOperator,
IR pSource1,
IR pSource2)
|
IR |
buildSymNode(Sym pSym)
|
void |
clear()
|
java.lang.Object |
clone()
|
boolean |
contains(java.lang.Object pObject)
|
java.lang.Object |
get(int pIndex)
|
IR |
getChild(int pNumber)
getChild |
IR |
getChild1()
getChild1 Get the first child of this node. |
IR |
getChild2()
getChild2 Get the second child of this node. |
int |
getChildCount()
getChildCount Get the number of children that may be attached to this node. |
IR |
getClone()
getClone |
java.lang.Object |
getFirst()
|
FlowAnalSym |
getFlowAnalSym()
|
java.lang.String |
getIndentSpace(int pIndent)
|
int |
getIndex()
getIndex Get the index number assigned to "this" node. |
java.lang.Object |
getInf(java.lang.String pInfKindInterned)
getInf Get the information of the kind pInfKindInterned. |
IrList |
getInfList()
getInfList Get the information list attached to this node. |
java.lang.String |
getIrName()
|
int |
getOperator()
getOperator Get operation code of "this" node. |
IR |
getParent()
getParent Get the parent of this node. |
Sym |
getResultOperand()
|
IR |
getSourceNode(int pNumber)
|
IR |
getSourceNode1()
|
IR |
getSourceNode2()
|
Sym |
getSym()
getSym Get the symbol represented by "this" node if this is a node representing a symbol (simple variable, element/field name, subprogram, label, constant, etc.). |
java.lang.Object |
getWork()
|
int |
indexOf(java.lang.Object pObject)
|
boolean |
isEmpty()
|
java.util.ListIterator |
iterator()
|
void |
print(int pIndent)
print Print this subtree in text format traversing all children of this node. |
void |
print(int pIndent,
boolean pDetail)
print Print this subtree in text format traversing all children of this node. |
java.lang.Object |
remove(int pRemovePosition)
|
boolean |
remove(java.lang.Object pObject)
|
void |
removeInf(java.lang.String pInfKindInterned)
removeInf Remove the information of the kind pInfKindInterned. |
void |
replaceOperator(int pOperator)
|
void |
replaceResultOperand(IR pOperand)
|
void |
replaceSource(int pNumber,
IR pOperand)
|
void |
replaceSource1(IR pOperand)
|
void |
replaceSource2(IR pOperand)
|
void |
replaceThisNode(IR pNewNode)
|
void |
set(int pIndex,
java.lang.Object pElement)
|
void |
setChild(int pNumber,
IR pIr)
setChild Set pHir as pNumber-th child of this node. |
void |
setChild1(IR p1)
|
void |
setChild2(IR p2)
|
void |
setIndex(int pIndex)
|
void |
setParent(IR pParent)
|
void |
setWork(java.lang.Object pWork)
|
int |
size()
|
java.lang.String |
toString()
|
java.lang.String |
toStringShort()
toStringShort |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public final HirRoot hirRoot
protected int fOperator
protected HirAnnex fHirAnnex
protected IR fParent
| Constructor Detail |
public IrListImpl(HirRoot pHirRoot,
java.util.LinkedList pList)
pList - LinkedList that may contain any objects.
If pList is null, an empty LinkedList is created.public IrListImpl(HirRoot pHirRoot)
| Method Detail |
public void add(java.lang.Object pElement)
add in interface IrList
public void add(int pInsertionPosition,
java.lang.Object pObjectToBeInserted)
add in interface IrListpublic java.lang.Object getFirst()
getFirst in interface IrListpublic java.lang.Object get(int pIndex)
get in interface IrList
public void set(int pIndex,
java.lang.Object pElement)
set in interface IrListpublic boolean isEmpty()
isEmpty in interface IrListpublic int size()
size in interface IrListpublic boolean contains(java.lang.Object pObject)
contains in interface IrListpublic int indexOf(java.lang.Object pObject)
indexOf in interface IrListpublic java.lang.Object remove(int pRemovePosition)
remove in interface IrListpublic void clear()
clear in interface IrListpublic boolean remove(java.lang.Object pObject)
remove in interface IrListpublic java.util.ListIterator iterator()
iterator in interface IrList
public java.lang.Object clone()
throws java.lang.ClassCastException
java.lang.ClassCastException
public IR getClone()
throws java.lang.CloneNotSupportedException
IrList
getClone in interface IrListjava.lang.CloneNotSupportedExceptionpublic java.lang.Object getWork()
public void setWork(java.lang.Object pWork)
public java.lang.String getIrName()
public IR buildSymNode(Sym pSym)
public IR buildNode(int pOperator)
public IR buildNode(int pOperator,
IR pSource1)
public IR buildNode(int pOperator,
IR pSource1,
IR pSource2)
public int getOperator()
IR0
getOperator in interface IR0public IR getParent()
IR
getParent in interface IRpublic void setParent(IR pParent)
public int getChildCount()
IR0
getChildCount in interface IR0public IR getChild1()
IR
getChild1 in interface IRpublic IR getChild2()
IR
getChild2 in interface IRpublic IR getChild(int pNumber)
IR0
getChild in interface IR0pNumber - the child number of the child to be returned.
public void setChild1(IR p1)
public void setChild2(IR p2)
public void setChild(int pNumber,
IR pIr)
IR0
setChild in interface IR0pNumber - Child number
public void addInf(java.lang.String pInfKindInterned,
java.lang.Object pInfObject)
IR
addInf in interface IRpInfObject - Object to be added as information.
It may be String, Sym, IR, List, and so on,
hence they may be non-IR elements.public java.lang.Object getInf(java.lang.String pInfKindInterned)
IR
getInf in interface IRpublic void removeInf(java.lang.String pInfKindInterned)
IR
removeInf in interface IRpublic IrList getInfList()
IR
getInfList in interface IRpublic int getIndex()
IR0
getIndex in interface IR0public void setIndex(int pIndex)
public IR getSourceNode1()
public IR getSourceNode2()
public IR getSourceNode(int pNumber)
public Sym getSym()
IR
getSym in interface IRpublic FlowAnalSym getFlowAnalSym()
public Sym getResultOperand()
public void replaceSource1(IR pOperand)
public void replaceSource2(IR pOperand)
public void replaceSource(int pNumber,
IR pOperand)
public void replaceResultOperand(IR pOperand)
public void replaceThisNode(IR pNewNode)
public void replaceOperator(int pOperator)
public java.lang.String getIndentSpace(int pIndent)
public java.lang.String toString()
public java.lang.String toStringShort()
IrList
toStringShort in interface IrListpublic void print(int pIndent)
IR
print in interface IRpIndent - number of heading spaces for indentation.
public void print(int pIndent,
boolean pDetail)
IR
print in interface IRpIndent - number of heading spaces for indentation.pDetail - true if detail print is requested, false otherwise.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||