coins.ir
クラス IrListImpl

java.lang.Object
  |
  +--coins.ir.IrListImpl
すべての実装インタフェース:
java.lang.Cloneable, IR, IR0, IrList

public class IrListImpl
extends java.lang.Object
implements IrList

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.


フィールドの概要
protected  HirAnnex fHirAnnex
           
protected  int fOperator
           
protected  IR fParent
           
 HirRoot hirRoot
           
 
インタフェース coins.ir.IR から継承したフィールド
OP_CODE_NAME, OP_INF, OP_LIST, OP_PROG, OP_SUBP_DEF
 
コンストラクタの概要
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.
 
メソッドの概要
 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
 
クラス java.lang.Object から継承したメソッド
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

フィールドの詳細

hirRoot

public final HirRoot hirRoot

fOperator

protected int fOperator

fHirAnnex

protected HirAnnex fHirAnnex

fParent

protected IR fParent
コンストラクタの詳細

IrListImpl

public IrListImpl(HirRoot pHirRoot,
                  java.util.LinkedList pList)
IrList constructor foe HIR Wrap pList so that it can be treated as IR node.

パラメータ:
pList - LinkedList that may contain any objects. If pList is null, an empty LinkedList is created.

IrListImpl

public IrListImpl(HirRoot pHirRoot)
メソッドの詳細

add

public void add(java.lang.Object pElement)
定義:
インタフェース IrList 内の add

add

public void add(int pInsertionPosition,
                java.lang.Object pObjectToBeInserted)
定義:
インタフェース IrList 内の add

getFirst

public java.lang.Object getFirst()
定義:
インタフェース IrList 内の getFirst

get

public java.lang.Object get(int pIndex)
定義:
インタフェース IrList 内の get

set

public void set(int pIndex,
                java.lang.Object pElement)
定義:
インタフェース IrList 内の set

isEmpty

public boolean isEmpty()
定義:
インタフェース IrList 内の isEmpty

size

public int size()
定義:
インタフェース IrList 内の size

contains

public boolean contains(java.lang.Object pObject)
定義:
インタフェース IrList 内の contains

indexOf

public int indexOf(java.lang.Object pObject)
定義:
インタフェース IrList 内の indexOf

remove

public java.lang.Object remove(int pRemovePosition)
定義:
インタフェース IrList 内の remove

clear

public void clear()
定義:
インタフェース IrList 内の clear

remove

public boolean remove(java.lang.Object pObject)
定義:
インタフェース IrList 内の remove

iterator

public java.util.ListIterator iterator()
定義:
インタフェース IrList 内の iterator

clone

public java.lang.Object clone()
                       throws java.lang.ClassCastException
オーバーライド:
クラス java.lang.Object 内の clone
java.lang.ClassCastException

getClone

public IR getClone()
            throws java.lang.CloneNotSupportedException
インタフェース IrList の記述:
getClone

定義:
インタフェース IrList 内の getClone
戻り値:
a clone of this list.
java.lang.CloneNotSupportedException

getWork

public java.lang.Object getWork()

setWork

public void setWork(java.lang.Object pWork)

getIrName

public java.lang.String getIrName()

buildSymNode

public IR buildSymNode(Sym pSym)

buildNode

public IR buildNode(int pOperator)

buildNode

public IR buildNode(int pOperator,
                    IR pSource1)

buildNode

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

getOperator

public int getOperator()
インタフェース IR0 の記述:
getOperator Get operation code of "this" node.

定義:
インタフェース IR0 内の getOperator
戻り値:
the operation code (value of operator field) of "this" node.

getParent

public IR getParent()
インタフェース IR の記述:
getParent Get the parent of this node.

定義:
インタフェース IR 内の getParent
戻り値:
the parent of this node. If this has no parent, return null.

setParent

public void setParent(IR pParent)

getChildCount

public int getChildCount()
インタフェース IR0 の記述:
getChildCount Get the number of children that may be attached to this node. Abbreviated child (null child) is also counted.

定義:
インタフェース IR0 内の getChildCount
戻り値:
the number of children of this node.

getChild1

public IR getChild1()
インタフェース IR の記述:
getChild1 Get the first child of this node. (This method does the same operation as getChild(1) but it may be more efficient.)

定義:
インタフェース IR 内の getChild1
戻り値:
the child 1 of this node.

getChild2

public IR getChild2()
インタフェース IR の記述:
getChild2 Get the second child of this node. (This method does the same operation as getChild(2) but it may be more efficient.)

定義:
インタフェース IR 内の getChild2
戻り値:
the child 2 of this node.

getChild

public IR getChild(int pNumber)
インタフェース IR0 の記述:
getChild

定義:
インタフェース IR0 内の getChild
パラメータ:
pNumber - the child number of the child to be returned.
戻り値:
the specified child of this node.

setChild1

public void setChild1(IR p1)

setChild2

public void setChild2(IR p2)

setChild

public void setChild(int pNumber,
                     IR pIr)
インタフェース IR0 の記述:
setChild Set pHir as pNumber-th child of this node.

定義:
インタフェース IR0 内の setChild
パラメータ:
pNumber - Child number

addInf

public void addInf(java.lang.String pInfKindInterned,
                   java.lang.Object pInfObject)
インタフェース 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).

定義:
インタフェース IR 内の addInf
パラメータ:
pInfObject - Object to be added as information. It may be String, Sym, IR, List, and so on, hence they may be non-IR elements.

getInf

public java.lang.Object getInf(java.lang.String pInfKindInterned)
インタフェース 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.

定義:
インタフェース IR 内の getInf
戻り値:
the object of the specified kind attached to this node.

removeInf

public void removeInf(java.lang.String pInfKindInterned)
インタフェース IR の記述:
removeInf Remove the information of the kind pInfKindInterned. If there is no information of the specified kind, then no effect remains.

定義:
インタフェース IR 内の removeInf

getInfList

public IrList getInfList()
インタフェース 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.

定義:
インタフェース IR 内の getInfList

getIndex

public int getIndex()
インタフェース 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.)

定義:
インタフェース IR0 内の getIndex
戻り値:
the index number assigned to "this" node. If the node has no index number, return 0.

setIndex

public void setIndex(int pIndex)

getSourceNode1

public IR getSourceNode1()

getSourceNode2

public IR getSourceNode2()

getSourceNode

public IR getSourceNode(int pNumber)

getSym

public Sym getSym()
インタフェース 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.).

定義:
インタフェース IR 内の getSym
戻り値:
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.)

getFlowAnalSym

public FlowAnalSym getFlowAnalSym()

getResultOperand

public Sym getResultOperand()

replaceSource1

public void replaceSource1(IR pOperand)

replaceSource2

public void replaceSource2(IR pOperand)

replaceSource

public void replaceSource(int pNumber,
                          IR pOperand)

replaceResultOperand

public void replaceResultOperand(IR pOperand)

replaceThisNode

public void replaceThisNode(IR pNewNode)

replaceOperator

public void replaceOperator(int pOperator)

getIndentSpace

public java.lang.String getIndentSpace(int pIndent)

toString

public java.lang.String toString()
オーバーライド:
クラス java.lang.Object 内の toString

toStringShort

public java.lang.String toStringShort()
インタフェース IrList の記述:
toStringShort

定義:
インタフェース IrList 内の toStringShort
戻り値:
the text representation of this list in short form.

print

public void print(int pIndent)
インタフェース 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).

定義:
インタフェース IR 内の print
パラメータ:
pIndent - number of heading spaces for indentation.

print

public void print(int pIndent,
                  boolean pDetail)
インタフェース 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).

定義:
インタフェース IR 内の print
パラメータ:
pIndent - number of heading spaces for indentation.
pDetail - true if detail print is requested, false otherwise.