coins.aflow
Class DefUseCell.DefNode

java.lang.Object
  extended bycoins.aflow.IrAdapter
      extended bycoins.aflow.DefUseCell.DefNode
All Implemented Interfaces:
java.lang.Cloneable, IR, IR0
Direct Known Subclasses:
UDChain.UseNode
Enclosing class:
DefUseCell

public static class DefUseCell.DefNode
extends IrAdapter


Field Summary
(package private)  java.lang.String fKind
           
 
Fields inherited from interface coins.ir.IR
OP_CODE_NAME, OP_INF, OP_LIST, OP_PROG, OP_SUBP_DEF
 
Constructor Summary
(package private) DefUseCell.DefNode(java.lang.String pKind)
           
 
Method Summary
 void addInf(java.lang.String pInfIdInterned, java.lang.Object pInfObject)
          addInf Add (attach) information pInfObject to this IR node.
 void attachInf(IR pNode)
           
 IR buildNode(int pOperator)
           
 IR buildNode(int pOperator, IR pSource1)
           
 IR buildNode(int pOperator, IR pSource1, IR pSource2)
           
 IR buildSymNode(Sym pSym)
           
 boolean equals(java.lang.Object pObj)
           
 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.
 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 pInfIdInterned)
          getInf Get the information of the kind pInfKindInterned.
 IrList getInfList()
          getInfList Get the information list attached to this node.
 IrList getInfList(java.lang.String pString)
           
 IR getInfNode()
           
 java.lang.String getInfString()
           
 java.lang.String getInfString(java.lang.String pString)
           
 java.lang.String getIrName()
           
 int getOperator()
          getOperator Get operation code of "this" node.
 IR getParent()
          getParent Get the parent of this node.
 Sym getResultOperand()
           
 Sym getResultVar()
           
 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 hashCode()
           
 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.
 void removeInf(java.lang.String pInfIdInterned)
          removeInf Remove the information of the kind pInfKindInterned.
 void replaceOperator(int pOperator)
           
 void replaceResultOperand(IR pOperand)
           
 void replaceResultVar(IR pOperand)
           
 void replaceSource(int pNumber, IR pOperand)
           
 void replaceSource1(IR pOperand)
           
 void replaceSource2(IR pOperand)
           
 void replaceThisNode(IR pNewNode)
           
 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 setInfList(java.lang.String pInfIdInterned, IrList pInfList)
           
 void setInfString(java.lang.String pInfIdInterned, java.lang.String pInfString)
           
 void setParent(IR pParent)
           
 void setWork(java.lang.Object pObject)
           
 java.lang.String toString()
           
 java.lang.String toStringShort()
          setChild Set pHir as pNumber-th child of this node.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

fKind

java.lang.String fKind
Constructor Detail

DefUseCell.DefNode

DefUseCell.DefNode(java.lang.String pKind)
Method Detail

hashCode

public int hashCode()

equals

public boolean equals(java.lang.Object pObj)

toString

public java.lang.String toString()

replaceSource2

public void replaceSource2(IR pOperand)

buildNode

public IR buildNode(int pOperator)

getChild1

public IR getChild1()
Description copied from interface: IR
getChild1 Get the first child of this node. (This method does the same operation as getChild(1) but it may be more efficient.)

Specified by:
getChild1 in interface IR
Returns:
the child 1 of this node.

replaceSource1

public void replaceSource1(IR pOperand)

replaceOperator

public void replaceOperator(int pOperator)

setChild2

public void setChild2(IR p2)

getIndentSpace

public java.lang.String getIndentSpace(int pIndent)

replaceResultVar

public void replaceResultVar(IR pOperand)

setChild1

public void setChild1(IR p1)

getSym

public Sym getSym()
Description copied from interface: IR
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.).

Specified by:
getSym in interface IR
Returns:
the symbol represented by "this" node. In HIR, it is Var if VarNode Subp if SubpNode, Label if LabelNode or LabelDef Elem if ElemNode // Field if FieldNode Const if ConstNode. If "this" node does not represent any symbol, then return null. (If "this" is HIR leaf or nonleaf node, the symbol attached to the node is returned. If "this" has no symbol attached, then return null. If "this" is LIR node representing a symbol, the symbol is returned. If "this" is LIR computation node, null is returned.)

getSourceNode

public IR getSourceNode(int pNumber)

setParent

public void setParent(IR pParent)

getSourceNode2

public IR getSourceNode2()

getSourceNode1

public IR getSourceNode1()

buildNode

public IR buildNode(int pOperator,
                    IR pSource1)

buildNode

public IR buildNode(int pOperator,
                    IR pSource1,
                    IR pSource2)

getChildCount

public int getChildCount()
Description copied from interface: IR0
getChildCount Get the number of children that may be attached to this node. Abbreviated child (null child) is also counted.

Specified by:
getChildCount in interface IR0
Returns:
the number of children of this node.

getOperator

public int getOperator()
Description copied from interface: IR0
getOperator Get operation code of "this" node.

Specified by:
getOperator in interface IR0
Returns:
the operation code (value of operator field) of "this" node.

print

public void print(int pIndent)
Description copied from interface: IR
print Print this subtree in text format traversing all children of this node. "this" may be any subtree (it may be a leaf node).

Specified by:
print in interface IR
Parameters:
pIndent - number of heading spaces for indentation.

replaceSource

public void replaceSource(int pNumber,
                          IR pOperand)

getIrName

public java.lang.String getIrName()

getResultVar

public Sym getResultVar()

getInfNode

public IR getInfNode()

buildSymNode

public IR buildSymNode(Sym pSym)

setIndex

public void setIndex(int pIndex)

attachInf

public void attachInf(IR pNode)

getParent

public IR getParent()
Description copied from interface: IR
getParent Get the parent of this node.

Specified by:
getParent in interface IR
Returns:
the parent of this node. If this has no parent, return null.

print

public void print(int pIndent,
                  boolean pDetail)
Description copied from interface: IR
print Print this subtree in text format traversing all children of this node. "this" may be any subtree (it may be a leaf node).

Specified by:
print in interface IR
Parameters:
pIndent - number of heading spaces for indentation.
pDetail - true if detail print is requested, false otherwise.

replaceThisNode

public void replaceThisNode(IR pNewNode)

setChild

public void setChild(int pNumber,
                     IR pIr)
Description copied from interface: IR0
setChild Set pHir as pNumber-th child of this node.

Specified by:
setChild in interface IR0
Parameters:
pNumber - Child number

getIndex

public int getIndex()
Description copied from interface: IR0
getIndex Get the index number assigned to "this" node. (The index number is used to refer the node in data flow analysis and debug-print.)

Specified by:
getIndex in interface IR0
Returns:
the index number assigned to "this" node. If the node has no index number, return 0.

getChild

public IR getChild(int pNumber)
Description copied from interface: IR0
getChild

Specified by:
getChild in interface IR0
Parameters:
pNumber - the child number of the child to be returned.
Returns:
the specified child of this node.

getChild2

public IR getChild2()
Description copied from interface: IR
getChild2 Get the second child of this node. (This method does the same operation as getChild(2) but it may be more efficient.)

Specified by:
getChild2 in interface IR
Returns:
the child 2 of this node.

setInfList

public void setInfList(java.lang.String pInfIdInterned,
                       IrList pInfList)

setInfString

public void setInfString(java.lang.String pInfIdInterned,
                         java.lang.String pInfString)

addInf

public void addInf(java.lang.String pInfIdInterned,
                   java.lang.Object pInfObject)
Description copied from interface: IR
addInf Add (attach) information pInfObject to this IR node. If information of the same kind is already exists in this node, then the old one is replaced with the new one (pInfObject).

Specified by:
addInf in interface IR
Parameters:
pInfObject - Object to be added as information. It may be String, Sym, IR, List, and so on, hence they may be non-IR elements.

getInfList

public IrList getInfList()
Description copied from interface: IR
getInfList Get the information list attached to this node. If no information is added, then null is returned. You can see if information is added or not by if (node.getInfList() == null) .... This method is prepared for persons who knows well the inside of the compiler. In ordinary usage, this method is unnecessary to be used. If you want to see the contents of the list, you should know the structure of the list defined in HirAnnex and LirAnnex.

Specified by:
getInfList in interface IR

getInfList

public IrList getInfList(java.lang.String pString)

getInfString

public java.lang.String getInfString()

getInfString

public java.lang.String getInfString(java.lang.String pString)

getInf

public java.lang.Object getInf(java.lang.String pInfIdInterned)
Description copied from interface: IR
getInf Get the information of the kind pInfKindInterned. If there is no information of the specified kind, then null is returned. The kind names are listed in coins.Registry class. It should be interned (in such way as "coins_pragma".intern()). If there is no information of the kind pInfKindInterned, then return null. Note that the value returned by getInf is not restricted to IR objects but it may be Sym, Const, String.

Specified by:
getInf in interface IR
Returns:
the object of the specified kind attached to this node.

removeInf

public void removeInf(java.lang.String pInfIdInterned)
Description copied from interface: IR
removeInf Remove the information of the kind pInfKindInterned. If there is no information of the specified kind, then no effect remains.

Specified by:
removeInf in interface IR

getFlowAnalSym

public FlowAnalSym getFlowAnalSym()

getResultOperand

public Sym getResultOperand()

replaceResultOperand

public void replaceResultOperand(IR pOperand)

setWork

public void setWork(java.lang.Object pObject)

getWork

public java.lang.Object getWork()

toStringShort

public java.lang.String toStringShort()
Description copied from interface: IR
setChild Set pHir as pNumber-th child of this node.

Specified by:
toStringShort in interface IR