coins.ir.hir
Class HIR_Impl

java.lang.Object
  extended bycoins.ir.hir.HIR_Impl
All Implemented Interfaces:
java.lang.Cloneable, HasStringObject, HIR, HIR0, IR, IR0
Direct Known Subclasses:
ExpImpl, HirListImpl, HirModify, HirSeqImpl, InfNodeImpl, LabelDefImpl, ProgramImpl, StmtImpl, SubpDefinitionImpl

public class HIR_Impl
extends java.lang.Object
implements HIR, HasStringObject, java.lang.Cloneable

HIR_Impl class


Field Summary
protected  IR[] fAdditionalChild
           
protected  int fChildCount
           
protected  IR fChildNode1
           
protected  IR fChildNode2
           
protected  int fDbgLevel
           
protected  HirAnnex fHirAnnex
           
protected  int fOperator
           
protected  IR fParentNode
           
protected  Type fType
           
 HirRoot hirRoot
           
(package private) static int[] inversionTable
           
protected static MachineParam machineParam
           
protected static SourceLanguage sourceLanguage
           
 
Fields inherited from interface coins.ir.hir.HIR
OP_CODE_NAME, OP_CODE_NAME_DENSE
 
Fields inherited from interface coins.ir.IR
OP_INF, OP_LIST, OP_PROG, OP_SUBP_DEF
 
Fields inherited from interface coins.ir.hir.HIR0
FLAG_C_PTR, FLAG_CONST_EXP, FLAG_INIT_BLOCK, FLAG_LOOP_WITH_CONDITIONAL_INIT, FLAG_NOCHANGE, FLAG_NONTERMINAL, OP_ADD, OP_ADD_ASSIGN, OP_ADDR, OP_AND, OP_AND_ASSIGN, OP_ARROW, OP_ASM, OP_ASSIGN, OP_BLOCK, OP_CALL, OP_CMP_EQ, OP_CMP_GE, OP_CMP_GT, OP_CMP_LE, OP_CMP_LT, OP_CMP_NE, OP_COMMA, OP_CONST, OP_CONTENTS, OP_CONV, OP_DECAY, OP_DIV, OP_DIV_ASSIGN, OP_ELEM, OP_ENCLOSE, OP_EQ_ZERO, OP_EXP_STMT, OP_EXPLIST, OP_EXPREPEAT, OP_FOR, OP_IF, OP_INDEX, OP_INDEXED_LOOP, OP_JUMP, OP_LABEL, OP_LABEL_DEF, OP_LABELED_STMT, OP_LG_AND, OP_LG_OR, OP_MOD, OP_MOD_ASSIGN, OP_MULT, OP_MULT_ASSIGN, OP_NEG, OP_NOT, OP_NULL, OP_OFFSET, OP_OR, OP_OR_ASSIGN, OP_PARAM, OP_PHI, OP_POST_DECR, OP_POST_INCR, OP_PRE_DECR, OP_PRE_INCR, OP_QUAL, OP_REPEAT, OP_RETURN, OP_SELECT, OP_SEQ, OP_SETDATA, OP_SHIFT_L_ASSIGN, OP_SHIFT_LL, OP_SHIFT_R, OP_SHIFT_R_ASSIGN, OP_SHIFT_RL, OP_SIZEOF, OP_STMT, OP_STMT_UPPER, OP_SUB, OP_SUB_ASSIGN, OP_SUBP, OP_SUBS, OP_SWITCH, OP_SYM, OP_TYPE, OP_UNDECAY, OP_UNTIL, OP_VAR, OP_WHILE, OP_XOR, OP_XOR_ASSIGN
 
Constructor Summary
  HIR_Impl()
          Default constructor
  HIR_Impl(HirRoot pHirRoot)
          Constructor to set hirRoot
protected HIR_Impl(HirRoot pHirRoot, int pOperator)
          Usually, HIR constructor should be given operation code.
 
Method Summary
 void accept(HirVisitor pVisitor)
          accept Acceptor used in HIR visitor.
 void addInf(java.lang.String pInfKindInterned, java.lang.Object pInfObject)
          addInf Add (attach) information pInfObject to this IR node.
 Exp addrExp(Exp pExp)
          addrExp Build addr expression representing the address of pExp.
 AsmStmt asmStmt(java.lang.String pInstructions, HirList pActualParamList)
          asmStmt Make a statement representing asm( formalParams, instructionList, actualParams ).
 AssignStmt assignStmt(Exp pLeft, Exp pRight)
          assignStmt Build an assignemnt statement.
 BlockStmt blockStmt(Stmt pStmtSequence)
          blockStmt Make an instance of block statement that may contain a sequence of statements.
 ExpStmt callStmt(Exp pSubpSpec, IrList pActualParamList)
          callStmt Build a subprogram call statement.
 void checkLinkage(java.lang.String pHeader)
          Check parent-child linkage if debug level (ioRoot.dbgHir.getLevel()) is greater than 0.
 java.lang.Object clone()
          clone Override Object.clone in HIR.
 Exp conditionalExp(Exp pExp)
          conditionalExp builds boolean expression to be used as conditional expression of IfStmt and LoopStmt.
 Exp conditionalExp1(Exp pExp)
           
 ConstNode constNode(Const pConst)
          constNode Make a ConstNode instance having constant symbol pConst.
 boolean contains(HIR pSubtree)
          Check if pSubtree is contained in this subtree.
 Exp contentsExp(Exp pPointerExp)
          contentsExp Build an expression that gets the contents pointed by pPointerExp.
 Exp convExp(Type pType, Exp pExp)
          convExp Build an expression to convert the type of pExp to pType.
 void copyInfListFrom(HIR pFromHir)
          Copy the contents of InfList attached to pFromHir to the InfList of this node.
 HIR copyWithOperands()
          copyWithOperands
 HIR copyWithOperandsChangingLabels(IrList pLabelCorrespondence)
          copyWithOperandsChangingLabels Copy this subtree changing labels that are defined in this subtree to avoid label duplication.
 void cutParentLink()
          cutParentLink Cut both links from/to parent node if they exist.
 void cutParentLink(int pChildNumber)
           
 Exp decayExp(Exp pExp)
          decayExp Build an expression that decay a vector to a pointer to vector element, or decay a String into a pointer to Char element.
 ElemNode elemNode(Elem pElem)
          elemNode Make an ElemNode instance having Elem symbol pElem.
 Exp exp(int pOperator, Exp pExp1)
          exp
 Exp exp(int pOperator, Exp pExp1, Exp pExp2)
          exp Build binary expression.
 Exp exp(int pOperator, Exp pExp1, Exp pExp2, Exp pExp3)
          exp: Build ternary expression (OP_SELECT, etc.).
 Exp expList(java.util.List pList)
          expList Make an expression representing a list of expressions, that is, make an instance of ExpListExp.
 Exp expRepeat(Exp pValue, Exp pCount)
          expRepeat Make an expression representing a list of expressions of the same value.
 ExpStmt expStmt(Exp pExp)
          expStmt Create a statement treating pExp as a statement.
 ConstNode falseNode()
          falseNode Make a ConstNode instance having boolean false value.
 void fatalError(int pId, java.lang.String pMessage)
           
 boolean finishHir()
           finishHir does closing operations for HIR.
 boolean flagsAreAllFalse()
           
 ForStmt forStmt(Stmt pInitStmt, Exp pCondition, Stmt pLoopBody, Stmt pStepPart)
           
 ForStmt forStmt(Stmt pInitStmt, Label pLoopBackLabel, Exp pCondition, Stmt pLoopBody, Label pLoopStepLabel, Stmt pStepPart, Label pLoopEndLabel)
           
 FunctionExp functionExp(Exp pFunctionSpec, IrList pActualParamList)
          functionExp Build a function expression node that computes function value.
 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.
 int getChildNumber()
          getChildNumber Get the child number of this node.
 IR getClone()
           
 ExpId getExpId()
          getExpId Get the expression identifier assigned to this node.
 boolean getFlag(int pFlagNumber)
          getFlag returns the value (true/false) of the flag indicated by pFlagNumber.
 FlagBox getFlagBox()
          getFlagBox Users are recommended to use getFlag( int pFlagNumber ) except when they understand the treatment of FlagBox in detail.
 FlowAnalSym getFlowAnalSym()
          getFlowAnalSym Get the flow analysis symbol assigned to this node if it is given.
 java.lang.String getIndentSpace(int pIndent)
          getIndentSace Get a sequence of spaces specified by 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 getInfString()
          Get the string image of Inf.
 java.lang.String getIrName()
          getIrName Get operation name and node index to display node in compact form for flow analysis, debug, etc.
 HIR getNextNode()
          getNextNode is not recommended to be used in traversing HIR subtree because it has high overhead.
protected  HIR getNextNodeSeeingAncestor(HIR pHir)
           
 Stmt getNextStmt()
          getNextStmt Get statement next to this statement.
 int getOperator()
          getOperator Get operation code of "this" node.
 IR getParent()
          getParent Get the parent of this node.
 Sym getResultOperand()
           
 Sym getResultVar()
           
 HIR getSourceNode(int pNumber)
          getSourceNode Get the pNumber-th source operand of "this" node.
 HIR getSourceNode1()
          getSourceNode1 Get the 1st source operand node of "this" node where the source is an operand used/refered in "this" operation.
 HIR getSourceNode2()
          getSourceNode2 Get the 2nd source operand node of "this" node.
 Stmt getStmtContainingThisNode()
          getStmtContainingThisNode Get the innermost statement or LabeledStmt containing this node by traversing ancestors of this node.
 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.).
 FlowAnalSym getSymOrExpId()
          getSymOrExpId If this is a SymNode with FlowAnalSym instance, then return it else return getExpId().
 Type getType()
          getType Get the type attached to this node.
 java.lang.Object getWork()
          getWork Get information set by setWork for this node.
 HIR hirClone()
          hirClone Make the clone of this node to get a clone in the situation where clone() can not be used directly.
 HirIterator hirIterator(IR pSubtree)
          hirIterator
 HirList hirList()
           
 HIR hirNodeClone()
          Make a copy of this HIR node without copying children.
 HirSeq hirSeq(HIR pChild1)
          hirSeq Make an HirSeq node that have some definite number of children.
 HirSeq hirSeq(HIR pChild1, HIR pChild2)
          hirSeq Make an HirSeq node that have some definite number of children.
 HirSeq hirSeq(HIR pChild1, HIR pChild2, HIR pChild3)
          hirSeq Make an HirSeq node that have some definite number of children.
 IfStmt ifStmt(Exp pCondition, Stmt pThenPart, Stmt pElsePart)
          ifStmt Build an if-statement with then-part (pThenPart) and else-part (pElsePart).
 IndexedLoopStmt indexedLoopStmt(Var pLoopIndex, Exp pStartValue, Exp pEndValue, Exp pStepValue, boolean pUpward, Stmt pStmtBody)
           
 IndexedLoopStmt indexedLoopStmt(Var pLoopIndex, Exp pStartValue, Exp pEndValue, Exp pStepValue, Stmt pStmtBody)
           
 InfStmt infStmt(java.lang.String pInfKind, IrList pInfData)
          infStmt Build an InfStmt representing some information.
 InfStmt infStmt(java.lang.String pInfKind, java.lang.Object pInfData)
           
 ConstNode intConstNode(int pIntValue)
          intConstNode Make a ConstNode instance having pIntValue as its value.
 ConstNode intConstNode(long pIntValue)
          intConstNode Make a ConstNode instance having pIntValue as its value.
 IrList irList()
          irList Make an empty HirList node that make a LinkedList.
 IrList irList(java.util.LinkedList pList)
          irList Make an HirList node that makes a LinkedList.
 boolean isEmpty(HIR pHir)
          isEmpty Decide if pHir is empty or not, where empty means either null, NullNode, HIR with OP_NULL as its operator, LabeledStmt whose statement body isEmpty, or ExpStmt whose Exp part isEmpty.
 boolean isHIR()
          Test if this is an HIR object.
 boolean isLIR()
           
 boolean isSameAs(HIR pTree)
          isSameAs Compare this tree with pTree and if they have the same tree shape (same operator and same operands) then return true.
 boolean isStmt()
          isStmt
 boolean isSym()
          Test if this is a Sym object.
 boolean isTerminal()
           
 boolean isTree()
          isTree Test if this does not violates tree structure, that is, detect node adherence in branches and handshake miss in parent-child relation.
protected  boolean isTree(java.util.Set pVisitedNodes, int pErrorCounter, java.util.Set pSetOfLabels)
          isTree Test if this does not violates tree structure, that is, detect node adherence in branches and handshake miss in parent-child relation.
 JumpStmt jumpStmt(Label pLabelSym)
          jumpStmt Create a jump statement and increment reference count of pLabelSym.
 LabelDef labelDef(Label pLabel)
          labelDef Make a LabelDef instance that defines the label pLabel.
 LabeledStmt labeledStmt(Label pLabel, Stmt pStmt)
          labeledStmt Build labeled statement using pLabel as its label and pStmt as its statement body.
 LabelNode labelNode(Label pLabel)
          labelNode Make a LabelNode instance having Label symbol pLabel.
 NullNode nullNode()
          nullNode Make a NullNode instance.
 Stmt nullStmt()
          nullStmt Make a statement having NullNode as its statement body.
 ConstNode offsetConstNode(long pIntValue)
          offsetConstNode Make a ConstNode instance having pIntValue as its offset value.
 PhiExp phiExp(Var pVar, Label pLabel)
          phiExp Make a phi expression used in SSA.
 PointedExp pointedExp(Exp pStructUnionExp, ElemNode pElemNode)
          pointedExp Build a pointed expression.
 void print(int pIndent)
          Print the object.
 void print(int pIndent, boolean pDetail)
          Print the object.
 Program program(Sym pProgSym, SymTable pGlobalSymTable, IR pInitiationPart, IrList pSubpList)
          program Make a program node.
 QualifiedExp qualifiedExp(Exp pStructUnionExp, ElemNode pElemNode)
          qualifiedExp Build a qualified expression.
 void removeInf(java.lang.String pInfKindInterned)
          removeInf Remove the information of the kind pInfKindInterned.
 RepeatStmt repeatStmt(Label pLoopBackLabel, Stmt pLoopBody, Label pLoopStepLabel, Exp pCondition, Label pLoopEndLabel)
           
 RepeatStmt repeatStmt(Stmt pLoopBody, Exp pCondition)
           
 void replaceOperator(int pOperator)
           
 void replaceResultOperand(HIR pOperand)
           
 void replaceResultVar(HIR pOperand)
           
 HIR replaceSource(int pNumber, IR pOperand)
          replaceSource Replace pNumber-th source operand of "this" node by pOperand.
 HIR replaceSource1(HIR pOperand)
          replaceSource1 Replace the source operand 1 of "this" node by pOperand.
 HIR replaceSource2(HIR pOperand)
          replaceSource2 Replace the source operand 2 of "this" node by pOperand.
 HIR replaceThisNode(HIR pNewNode)
          replaceThisNode Replace "this" node by pNewNode.
 ReturnStmt returnStmt()
          returnStmt Build return statement that terminates the execution of current subprogram under construction.
 ReturnStmt returnStmt(Exp pReturnValue)
          returnStmt Build return statement that terminates the execution of current subprogram under construction.
 void setChild(int pNumber, IR pHir)
          setChild Set pHir as pNumber-th child of this node.
 void setChild1(IR pChild)
           
 void setChild2(IR pChild)
           
 void setChildren(IR p1, IR p2)
           
 void setChildren(IR p1, IR p2, IR p3)
           
 void setChildren(IR p1, IR p2, IR p3, IR p4)
           
 void setChildren(IR p1, IR p2, IR p3, IR p4, IR p5)
           
 SetDataStmt setDataStmt(Exp pVariable, Exp pValueExp)
          setDataStmt Make the statement that sets initial value or a list of initial values (pValueExp) to a variable (pVariable).
 void setFlag(int pFlagNumber, boolean pYesNo)
          setFlag setFlag sets the flag of specified number.
 void setIndex(int pIndex)
          setIndex Set an index number to "this" node.
 int setIndexNumberToAllNodes(int pStartNumber)
          setIndexNumberToAllNodes Set sequencial index number to all nodes traversing the subtree rooted by this node in depth-first order.
 int setIndexNumberToAllNodes(int pStartNumber, boolean pResetSymIndex)
          Set index number to all nodes and if pResetSymIndex is true, reset Sym index by resetFlowAnalInf for FlowAnalSym nodes.
 int setIndexNumberToAllNodes2(int pStartNumber, boolean pResetSymIndex)
           
 void setParameters(MachineParam pMachineParam, SourceLanguage pSourceLanguage)
           
 void setParent(IR pParent)
          setParent Set the parent of this node as pParent.
 void setType(Type pType)
          setType Attach a type to this node.
 void setWork(java.lang.Object pWork)
          setWork Set information privately used in each phase.
 void severeError(int pId, java.lang.String pMessage)
           
 Exp sizeofExp(Exp pExp)
          sizeofExp Build the expression that get the size of pExp.
 Exp sizeofExp(Type pType)
          sizeofExp Build the expression that get the size of pType.
 void slightError(int pId, java.lang.String pMessage)
           
 SubpDefinition subpDefinition(Subp pSubpSym)
           
 SubpDefinition subpDefinition(Subp pSubpSym, SymTable pLocalSymTable)
          subpDefifnition Make a subprogram definition node and set symRoot.subpCurrent = pSubpSym, set symRoot.symTableCurrentSubp = pLocalSymTable.
 SubpDefinition subpDefinition(Subp pSubpSym, SymTable pLocalSymTable, BlockStmt pInitiationPart, BlockStmt pHIRbody)
          subpDefinition with full specification.
 java.util.Iterator subpIterator()
          subpIterator Make an iterator that traverses all subprogram definitions in the current compile unit.
 SubpNode subpNode(Subp pSubp)
          subpNode Make a SubpNode instance having Subp symbol pSubp.
 SubscriptedExp subscriptedExp(Exp pArrayExp, Exp pSubscript)
          subscriptedExp Build a subscripted expression.
 Exp subscriptedExp(Exp pArrayExp, Exp pSubscript, Exp pElemSize)
          subscriptedExp Build an expression representing the indicated element of a vector whose element size is unfixed.
 SwitchStmt switchStmt(Exp pSelectExp, IrList pJumpList, Label pDefaultLabel, Stmt pSwitchBody, Label pEndLabel)
          switchStmt Make a SwitchStmt instance.
 SymNode symNode(Sym pSym)
          symNode Make a SymNode instance having pSym as attached symbol.
 java.lang.String toString()
          toString Get text representation of this node without traversing children.
 java.lang.String toStringDetail()
          toStringDetail Get text string of this node showing detail information.
 java.lang.String toStringShort()
          toStringShort Get text string of this node showing node name and index only.
 java.lang.String toStringWithChildren()
          toStringWithChildren Get the string of this node and its children traversing the children in depth-first order.
 ConstNode trueNode()
          trueNode Make a ConstNode instance having boolean true value.
 TypeNode typeNode(Type pType)
           
 Exp undecayExp(Exp pPointerExp, ConstNode pElemCount)
          undecayExp Build an expression that undecay a pointer to a vector whose element type is pointed type.
 Exp undecayExp(Exp pPointerExp, Exp pElemCount, Exp pLowerBound)
          undecayExp Build an expression that undecay a pointer to a vector whose element type is pointed type.
 Exp undecayExp(Exp pPointerExp, long pElemCount)
          undecayExp Build an expression that undecay a pointer to a vector whose element type is pointed type.
 Exp undecayExp(Exp pPointerExp, long pElemCount, long pLowerBound)
          undecayExp Build an expression that undecay a pointer to a vector whose element type is pointed type.
 VarNode varNode(Var pVar)
          varNode Make a VarNode instance having Var symbol pVar.
 void warinig(int pId, java.lang.String pMessage)
           
 WhileStmt whileStmt(Exp pCondition, Stmt pLoopBody)
           
 WhileStmt whileStmt(Label pLoopBackLabel, Exp pCondition, Stmt pLoopBody, Label pLoopStepLabel, Label pLoopEndLabel)
          ifStmt Build an if-statement with then-part (pThenPart) and else-part (pElsePart).
 boolean withInf()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

hirRoot

public final HirRoot hirRoot

fOperator

protected int fOperator

fChildNode1

protected IR fChildNode1

fChildNode2

protected IR fChildNode2

fAdditionalChild

protected IR[] fAdditionalChild

fParentNode

protected IR fParentNode

fChildCount

protected int fChildCount

fHirAnnex

protected HirAnnex fHirAnnex

fType

protected Type fType

fDbgLevel

protected final int fDbgLevel

machineParam

protected static MachineParam machineParam

sourceLanguage

protected static SourceLanguage sourceLanguage

inversionTable

static final int[] inversionTable
Constructor Detail

HIR_Impl

public HIR_Impl()
Default constructor


HIR_Impl

public HIR_Impl(HirRoot pHirRoot)
Constructor to set hirRoot


HIR_Impl

protected HIR_Impl(HirRoot pHirRoot,
                   int pOperator)
Usually, HIR constructor should be given operation code.

Method Detail

setParameters

public void setParameters(MachineParam pMachineParam,
                          SourceLanguage pSourceLanguage)

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.

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.

setParent

public void setParent(IR pParent)
Description copied from interface: HIR
setParent Set the parent of this node as pParent. This method should be used carefully so that consistency is kept. It is not recommended to use this method except in the methods built-in in coins/ir, coins/ir/hir, coins/ir/lir. Almost all HIR nodes has parent but some LIR node has no parent in which case, setParent will have no effect. (LIRTreeList, LIRTree have no parent.)

Specified by:
setParent in interface HIR
Parameters:
pParent - node to be set as parent of this node.

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.

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.

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.

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.

setChild1

public void setChild1(IR pChild)
Specified by:
setChild1 in interface HIR

setChild2

public void setChild2(IR pChild)
Specified by:
setChild2 in interface HIR

setChild

public void setChild(int pNumber,
                     IR pHir)
setChild Set pHir as pNumber-th child of this node.

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

getChildNumber

public int getChildNumber()
Description copied from interface: HIR0
getChildNumber Get the child number of this node. If not found, return -1. (Usually, it is unnecessary to use this because the child number is known by stack, etc.)

Specified by:
getChildNumber in interface HIR0

addInf

public void addInf(java.lang.String pInfKindInterned,
                   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.

getInf

public java.lang.Object getInf(java.lang.String pInfKindInterned)
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 pInfKindInterned)
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

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

copyInfListFrom

public void copyInfListFrom(HIR pFromHir)
Description copied from interface: HIR
Copy the contents of InfList attached to pFromHir to the InfList of this node. If this node has Inf of the same kind as that of pFromHir, then it is replaced by that of pFromHir. If this node has Inf that is not included in pFromHir, then the Inf remains unchanged. If pFromHir has no Inf, then do nothing.

Specified by:
copyInfListFrom in interface HIR
Parameters:
pFromHir - HIR node that may have InfList.

getInfString

public java.lang.String getInfString()
Description copied from interface: HIR
Get the string image of Inf. If there is no Inf, return "".

Specified by:
getInfString in interface HIR
Returns:
the string image of Inf.

withInf

public boolean withInf()

getWork

public java.lang.Object getWork()
Description copied from interface: HIR
getWork Get information set by setWork for this node. Users should cast by the name of the class used in setWork.

Specified by:
getWork in interface HIR
Returns:
the information object set by setWork. This method is moved to IR interface.

setWork

public void setWork(java.lang.Object pWork)
Description copied from interface: HIR
setWork Set information privately used in each phase.

Specified by:
setWork in interface HIR
Parameters:
pWork - any information of arbitrary class to be set to this node; You may define a new class that represents arbitrary information and give its reference as pWork. This method is moved to IR interface.

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.

setIndex

public void setIndex(int pIndex)
Description copied from interface: HIR
setIndex Set an index number to "this" node. (The index number is used to refer the node in data flow analysis.)

Specified by:
setIndex in interface HIR
Parameters:
pIndex - the index number to be assigned to "this" node.

isStmt

public boolean isStmt()
Description copied from interface: HIR
isStmt

Specified by:
isStmt in interface HIR
Returns:
true if this node is a statement node, otherwise return false.

getStmtContainingThisNode

public Stmt getStmtContainingThisNode()
Description copied from interface: HIR0
getStmtContainingThisNode Get the innermost statement or LabeledStmt containing this node by traversing ancestors of this node. If this is a statement, then this is the innermost statement. If the the parent of the innermost statement is a LabeledStmt, then the LabeledStmt is returned else the innermost statement is returned.

Specified by:
getStmtContainingThisNode in interface HIR0
Returns:
the innermost statement or LabeledStmt containing this node.

getExpId

public ExpId getExpId()
Description copied from interface: HIR
getExpId Get the expression identifier assigned to this node.

Specified by:
getExpId in interface HIR
Returns:
the expression identifier assigned to this node, or return null if it is not assigned.

getSymOrExpId

public FlowAnalSym getSymOrExpId()
Description copied from interface: HIR
getSymOrExpId If this is a SymNode with FlowAnalSym instance, then return it else return getExpId().

Specified by:
getSymOrExpId in interface HIR
Returns:
FlowAnalSym or ExpId attached to this node.

getFlowAnalSym

public FlowAnalSym getFlowAnalSym()
Description copied from interface: HIR
getFlowAnalSym Get the flow analysis symbol assigned to this node if it is given. FlowAnalSym is either Var, Reg, or ExpId. (See coins.sym.FlowAnalSym.)

Specified by:
getFlowAnalSym in interface HIR
Returns:
the flow analysis symbol assigned to this node, or return null if it is not assigned.

getSourceNode1

public HIR getSourceNode1()
Description copied from interface: HIR
getSourceNode1 Get the 1st source operand node of "this" node where the source is an operand used/refered in "this" operation. See getSourceNode1 of HIR interface and LIR interface.

Specified by:
getSourceNode1 in interface HIR
Returns:
1st source operand of "this" node, return null if "this" has no source operand 1. If "this" is HIR node, its child 1 is returned. If "this" is LIR node, the node computing its operand 1 is returned; If there is no such node, null is returned.

getSourceNode2

public HIR getSourceNode2()
Description copied from interface: HIR
getSourceNode2 Get the 2nd source operand node of "this" node. Other matters and conditions are just like those of getSourceNode1.

Specified by:
getSourceNode2 in interface HIR
Returns:
2nd source operand of "this" node. return null if "this" has no 2nd source operand.

getSourceNode

public HIR getSourceNode(int pNumber)
Description copied from interface: HIR
getSourceNode Get the pNumber-th source operand of "this" node. Other matters and conditions are just like those of getSourceNode1.

Specified by:
getSourceNode in interface HIR
Parameters:
pNumber - 1: source 1, 2: source 2, 3: source 3, ... .
Returns:
the pNumber-th source operand of "this" node, return null if "this" has no pNumber-th source operand.

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.)

getResultOperand

public Sym getResultOperand()

getResultVar

public Sym getResultVar()

replaceSource1

public HIR replaceSource1(HIR pOperand)
Description copied from interface: HIR
replaceSource1 Replace the source operand 1 of "this" node by pOperand. "this" should be a node that can have source operand 1, that is, nonleaf node if "this" is HIR node, etc.

Specified by:
replaceSource1 in interface HIR
Parameters:
pOperand - node that take place of source operand 1.

replaceSource2

public HIR replaceSource2(HIR pOperand)
Description copied from interface: HIR
replaceSource2 Replace the source operand 2 of "this" node by pOperand. Other matters and conditions are just like those of replaceSource1. "this" should be a node that can have source operand 2.

Specified by:
replaceSource2 in interface HIR
Parameters:
pOperand - node that take place of source operand 2.

replaceSource

public HIR replaceSource(int pNumber,
                         IR pOperand)
Description copied from interface: HIR
replaceSource Replace pNumber-th source operand of "this" node by pOperand. Other matters and conditions are just like those of replaceSource1. "this" should be a node that can have source operand, that is, nonleaf node if "this" is HIR node, etc.

Specified by:
replaceSource in interface HIR
Parameters:
pNumber - 1: source 1, 2: source 2, 3: source 3, ... .
pOperand - node that take place of source operand.

replaceResultOperand

public void replaceResultOperand(HIR pOperand)

replaceResultVar

public void replaceResultVar(HIR pOperand)

replaceThisNode

public HIR replaceThisNode(HIR pNewNode)
Description copied from interface: HIR0
replaceThisNode Replace "this" node by pNewNode. If this has parent, then the link between this and the parent is changed to the link between pNewNode and the parent. "this" may be any node that makes sense by replacement.

Specified by:
replaceThisNode in interface HIR0
Parameters:
pNewNode - node that takes place of "this" node.

replaceOperator

public void replaceOperator(int pOperator)

cutParentLink

public void cutParentLink()
Description copied from interface: HIR
cutParentLink Cut both links from/to parent node if they exist. (Used to prepare for moving a node.) This method is prepared for factory methods and it is not recommended to use this method except when user knows the structure of HIR in detail.

Specified by:
cutParentLink in interface HIR

cutParentLink

public void cutParentLink(int pChildNumber)

isSym

public boolean isSym()
Description copied from interface: HasStringObject
Test if this is a Sym object.

Specified by:
isSym in interface HasStringObject
Returns:
true if this is a Sym object, false otherwise.

isHIR

public boolean isHIR()
Description copied from interface: HasStringObject
Test if this is an HIR object.

Specified by:
isHIR in interface HasStringObject
Returns:
true if this is an HIR object, false otherwise.

isLIR

public boolean isLIR()

isEmpty

public boolean isEmpty(HIR pHir)
Description copied from interface: HIR
isEmpty Decide if pHir is empty or not, where empty means either null, NullNode, HIR with OP_NULL as its operator, LabeledStmt whose statement body isEmpty, or ExpStmt whose Exp part isEmpty.

Specified by:
isEmpty in interface HIR
Parameters:
pHir - HIR node to be tested if empty or not.
Returns:
true if pHir is empty else retuen false.

isTerminal

public boolean isTerminal()

contains

public boolean contains(HIR pSubtree)
Description copied from interface: HIR
Check if pSubtree is contained in this subtree. It is not recommended to apply this method to large subtree but recommended to apply to small subtree such as expressions.

Specified by:
contains in interface HIR
Parameters:
pSubtree - subtree to be searched.
Returns:
true if found, false if not found.

toString

public java.lang.String toString()
Description copied from interface: HIR
toString Get text representation of this node without traversing children.

Specified by:
toString in interface HIR

toStringShort

public java.lang.String toStringShort()
Description copied from interface: HIR
toStringShort Get text string of this node showing node name and index only.

Specified by:
toStringShort in interface HIR

toStringDetail

public java.lang.String toStringDetail()
Description copied from interface: HIR
toStringDetail Get text string of this node showing detail information.

Specified by:
toStringDetail in interface HIR

toStringWithChildren

public java.lang.String toStringWithChildren()
Description copied from interface: HIR
toStringWithChildren Get the string of this node and its children traversing the children in depth-first order. The result is shown in compact form.

Specified by:
toStringWithChildren in interface HIR
Returns:
the string of this node and its children.

getIrName

public java.lang.String getIrName()
Description copied from interface: HIR
getIrName Get operation name and node index to display node in compact form for flow analysis, debug, etc.

Specified by:
getIrName in interface HIR

print

public void print(int pIndent)
Description copied from interface: HasStringObject
Print the object.

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

print

public void print(int pIndent,
                  boolean pDetail)
Description copied from interface: HasStringObject
Print the object.

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

getIndentSpace

public java.lang.String getIndentSpace(int pIndent)
Description copied from interface: HIR
getIndentSace Get a sequence of spaces specified by pIndent.

Specified by:
getIndentSpace in interface HIR
Parameters:
pIndent - number of spaces to be generated.
Returns:
a string of spaces.

setIndexNumberToAllNodes

public int setIndexNumberToAllNodes(int pStartNumber)
Description copied from interface: HIR0
setIndexNumberToAllNodes Set sequencial index number to all nodes traversing the subtree rooted by this node in depth-first order. The index number of this node is set to pStartNumber. If this node is an instance of SubpDefinition, then the minimum and the maximum of the index numberes set to the nodes of this subtree are recorded in SubpDefinition instance so that they can be accessed by getNodeIndexMin() and getNodeIndexMax() of SubpDefinition.

Specified by:
setIndexNumberToAllNodes in interface HIR0
Parameters:
pStartNumber - starting value of the index (greater than 0).
Returns:
(the last index number) + 1.

setIndexNumberToAllNodes

public int setIndexNumberToAllNodes(int pStartNumber,
                                    boolean pResetSymIndex)
Description copied from interface: HIR
Set index number to all nodes and if pResetSymIndex is true, reset Sym index by resetFlowAnalInf for FlowAnalSym nodes.

Specified by:
setIndexNumberToAllNodes in interface HIR
Parameters:
pStartNumber -
pResetSymIndex - true if resetFlowAnalInf is to be done.
Returns:
the largest index number set to nodes.

setIndexNumberToAllNodes2

public int setIndexNumberToAllNodes2(int pStartNumber,
                                     boolean pResetSymIndex)

finishHir

public boolean finishHir()
Description copied from interface: HIR0
 finishHir does closing operations for HIR.
 finishHir should be called for Program or SubpDefinition
 when HIR building or restructuring were completed in such
 timing as
   at the end of new HIR generation in front-end
    (call for hirRoot.programRoot),
   at the end of restructuring (optimization, parallelization, etc.)
    (call for corresponding SubpDefinition subtree).
 If finishHir is scheduled to be called for programRoot after successive
 generation or restructuring of SubpDefinitions before passing it to other
 phases, then it is unnecessary to call it for each SubpDefinition.
 finishHir set index number to all nodes of this subtree
 and verifies its tree structure.
 It also certificates the value of getHirPosition() for labels  //##60
 and buildLabelRefList is called for SubpDefinition
 (for Program, buildLabelRefList is called for every SubpDefinitions). //##62
 If finishHir is called then it is not necessary to call
 setIndexNumberToAllNnodes() nor isTree().
 If error is found, then finishHir() returns false after isuing
 error message. If no error is found then it returns true.
 In either case, processing will continue.

Specified by:
finishHir in interface HIR0
Returns:
true if descrepancy is not found, false if descrepancy is found.

warinig

public void warinig(int pId,
                    java.lang.String pMessage)

slightError

public void slightError(int pId,
                        java.lang.String pMessage)

severeError

public void severeError(int pId,
                        java.lang.String pMessage)

fatalError

public void fatalError(int pId,
                       java.lang.String pMessage)

program

public Program program(Sym pProgSym,
                       SymTable pGlobalSymTable,
                       IR pInitiationPart,
                       IrList pSubpList)
Description copied from interface: HIR0
program Make a program node. See Program interface.

Specified by:
program in interface HIR0
Parameters:
pProgSym - Program name (may be null).
pGlobalSymTable - Symbol table for global symbols.
pInitiationPart - Initiation statement (may be null).
pSubpList - List of subprograms; At first, it may be an empty list; (See addSubpDefinition of Program interface).

subpDefinition

public SubpDefinition subpDefinition(Subp pSubpSym,
                                     SymTable pLocalSymTable)
Description copied from interface: HIR0
subpDefifnition Make a subprogram definition node and set symRoot.subpCurrent = pSubpSym, set symRoot.symTableCurrentSubp = pLocalSymTable. You may add initiation-part, HIR-body later by using addInitiationStmt, setHirBody of SubpDefinition interface. Start label and end label for the given subprogram are generated to make getStartLabel(), getEndLabel() of Subp interface effective.

Specified by:
subpDefinition in interface HIR0
Parameters:
pSubpSym - Subprogram symbol. Should be given.
pLocalSymTable - Symbol table local in the subprogram; If subprogram uses a local symbol table, this parameter should be given (by using pushSymTable() of SymTable interface); If the source language permits no local symbol for subprogram, this parameter may be null.
Returns:
the created SubpDefinition instance.

subpDefinition

public SubpDefinition subpDefinition(Subp pSubpSym)

subpDefinition

public SubpDefinition subpDefinition(Subp pSubpSym,
                                     SymTable pLocalSymTable,
                                     BlockStmt pInitiationPart,
                                     BlockStmt pHIRbody)
Description copied from interface: HIR
subpDefinition with full specification. Other items are the same as the previous method.

Specified by:
subpDefinition in interface HIR
Parameters:
pSubpSym - Subprogram symbol. Should be given.
pLocalSymTable - Symbol table local in the subprogram; If subprogram uses a local symbol table, this parameter should be given (by using pushSymTable() of SymTable interface); Even if the source program does not use local symbol, this parameter is required to register temporal variables and internal labels generated by the compiler. //##51
pInitiationPart - Initiation statement block. optional.
pHIRbody - Subprogram body in HIR. optional.

irList

public IrList irList(java.util.LinkedList pList)
Description copied from interface: HIR
irList Make an HirList node that makes a LinkedList. The created list can be treated as an HIR node.

Specified by:
irList in interface HIR
Parameters:
pList - List of objects to be included in the HirList; The elements of the list are an HIR object or Sym object.
Returns:
IrList containing pList; Resultant list is also an instance of HIR.

irList

public IrList irList()
Description copied from interface: HIR0
irList Make an empty HirList node that make a LinkedList. Use methods of IrList to add elements to the list. The elements to be added are an HIR object or Sym object. The created list can be treated as an HIR node.

Specified by:
irList in interface HIR0
Returns:
an empty IrList; Resultant list is also an instance of HIR.

hirList

public HirList hirList()
Specified by:
hirList in interface HIR0

infStmt

public InfStmt infStmt(java.lang.String pInfKind,
                       IrList pInfData)
Description copied from interface: HIR
infStmt Build an InfStmt representing some information. The information may be defined in each compiler for arbitrary purpose.

Specified by:
infStmt in interface HIR
Parameters:
pInfKind -
pInfData -
Returns:
the InfNode created. ***deprecated InfNode was deleted. Use infStmt method.

infStmt

public InfStmt infStmt(java.lang.String pInfKind,
                       java.lang.Object pInfData)
Specified by:
infStmt in interface HIR

varNode

public VarNode varNode(Var pVar)
Description copied from interface: HIR0
varNode Make a VarNode instance having Var symbol pVar.

Specified by:
varNode in interface HIR0
Parameters:
pVar - Variable symbol to be attached to the node.
Returns:
the resultant VarNode.

elemNode

public ElemNode elemNode(Elem pElem)
Description copied from interface: HIR0
elemNode Make an ElemNode instance having Elem symbol pElem.

Specified by:
elemNode in interface HIR0
Parameters:
pElem - Struct/union element symbol to be attached to the node.
Returns:
the resultant ElemNode.

subpNode

public SubpNode subpNode(Subp pSubp)
Description copied from interface: HIR0
subpNode Make a SubpNode instance having Subp symbol pSubp.

Specified by:
subpNode in interface HIR0
Parameters:
pSubp - Subprogram symbol to be attached to the node.
Returns:
the resultant SubpNode.

typeNode

public TypeNode typeNode(Type pType)

labelNode

public LabelNode labelNode(Label pLabel)
Description copied from interface: HIR0
labelNode Make a LabelNode instance having Label symbol pLabel. (See labelDef.)

Specified by:
labelNode in interface HIR0
Parameters:
pLabel - Label symbol to be attached to the node.
Returns:
the resultant LabelNode.

constNode

public ConstNode constNode(Const pConst)
Description copied from interface: HIR0
constNode Make a ConstNode instance having constant symbol pConst.

Specified by:
constNode in interface HIR0
Parameters:
pConst - Constant symbol to be attached to the node.
Returns:
the resultant ConstNode.

intConstNode

public ConstNode intConstNode(int pIntValue)
Description copied from interface: HIR
intConstNode Make a ConstNode instance having pIntValue as its value. The constant value is changed to Const symbol and attached to the constant node.

Specified by:
intConstNode in interface HIR
Parameters:
pIntValue - Integer value to be attached to the node.
Returns:
the resultant ConstNode.

intConstNode

public ConstNode intConstNode(long pIntValue)
Description copied from interface: HIR0
intConstNode Make a ConstNode instance having pIntValue as its value. The constant value is changed to Const symbol and attached to the constant node.

Specified by:
intConstNode in interface HIR0
Parameters:
pIntValue - Integer value to be attached to the node.
Returns:
the resultant ConstNode.

offsetConstNode

public ConstNode offsetConstNode(long pIntValue)
Description copied from interface: HIR
offsetConstNode Make a ConstNode instance having pIntValue as its offset value. The offset value pIntValue is changed to Const symbol and attached to the constant node.

Specified by:
offsetConstNode in interface HIR
Parameters:
pIntValue - Offset value to be attached to the node.
Returns:
the resultant ConstNode.

trueNode

public ConstNode trueNode()
Description copied from interface: HIR0
trueNode Make a ConstNode instance having boolean true value.

Specified by:
trueNode in interface HIR0
Returns:
the true ConstNode.

falseNode

public ConstNode falseNode()
Description copied from interface: HIR0
falseNode Make a ConstNode instance having boolean false value.

Specified by:
falseNode in interface HIR0
Returns:
the false ConstNode.

symNode

public SymNode symNode(Sym pSym)
Description copied from interface: HIR0
symNode Make a SymNode instance having pSym as attached symbol. This method is used for symbols other than Var, Elem, Subp, Label, and constant.

Specified by:
symNode in interface HIR0
Parameters:
pSym - Symbol to be attached to the node.
Returns:
the resultant SymNode.

nullNode

public NullNode nullNode()
Description copied from interface: HIR
nullNode Make a NullNode instance.

Specified by:
nullNode in interface HIR
Returns:
the NullNode.

labelDef

public LabelDef labelDef(Label pLabel)
Description copied from interface: HIR0
labelDef Make a LabelDef instance that defines the label pLabel. (See labelNode.)

Specified by:
labelDef in interface HIR0
Parameters:
pLabel - Label symbol to be defined.
Returns:
the resultant LabelDef.

exp

public Exp exp(int pOperator,
               Exp pExp1)
Description copied from interface: HIR0
exp
  Build unary expression according to the
  operator given:
  OP_NOT      // bitwise not (~) one's complement
              // logical not for bool (!)
  OP_NEG      // negate (unary minus)
  OP_ADDR     // get address (&)
  OP_CONTENTS // get contents of pointed memory
  OP_CONV     // type conversion for basic type
  OP_DECAY    // convert array to pointer
  OP_SIZEOF   // sizeof operator
  OP_ENCLOSE  // honor parenthesis
  The type of resultant expression is set according to the rule
  described in the HIR specifications, however, it may be necessary
  to do language-wise treatment. In such case, front-end part of the
  language should set type after creating the instance of Exp.
  (In C, expressions related to pointer and vector are specially
   treated in C front end ToHirC.)

 

Specified by:
exp in interface HIR0
Parameters:
pOperator - unary operator such as OP_NOT, OP_NEG, OP_ADDR, OP_CONTENTS, OP_CONV, OP_DECAY, OP_SIZEOF, OP_ENCLOSE defined in HIR interface.
pExp1 - operand expression.
Returns:
the resultant unary expression subtree.

exp

public Exp exp(int pOperator,
               Exp pExp1,
               Exp pExp2)
Description copied from interface: HIR0
exp Build binary expression. The type of resultant expression is set according to the rule described in the HIR specifications, however, it may be necessary to do language-wise treatment. In such case, front-end part of the language should set type after creating the instance of Exp. (In C, expressions related to pointer and vector are specially treated in C front end ToHirC.)

Specified by:
exp in interface HIR0
Parameters:
pOperator - binary operator such as OP_ADD, OP_MULT, etc. defined in HIR interface.
pExp1 - operand 1 expression.
pExp2 - operand 2 expression.
Returns:
the resultant binary expression subtree.

exp

public Exp exp(int pOperator,
               Exp pExp1,
               Exp pExp2,
               Exp pExp3)
Description copied from interface: HIR
exp: Build ternary expression (OP_SELECT, etc.).

Specified by:
exp in interface HIR
Parameters:
pExp1 - operand 1 expression.
pExp2 - operand 2 expression.
pExp3 - operand 3 expression.
Returns:
the resultant ternary expression subtree.

decayExp

public Exp decayExp(Exp pExp)
Description copied from interface: HIR0
decayExp Build an expression that decay a vector to a pointer to vector element, or decay a String into a pointer to Char element.

Specified by:
decayExp in interface HIR0
Parameters:
pExp - vector variable or string constant.
Returns:
decay expression with pointer type.

undecayExp

public Exp undecayExp(Exp pPointerExp,
                      ConstNode pElemCount)
Description copied from interface: HIR
undecayExp Build an expression that undecay a pointer to a vector whose element type is pointed type.

Specified by:
undecayExp in interface HIR
Parameters:
pPointerExp - pointer expression pointing to the first element of the resultant vector.
pElemCount - Constant expression showing element count of the resultant vector.
Returns:
the vector expression.

undecayExp

public Exp undecayExp(Exp pPointerExp,
                      Exp pElemCount,
                      Exp pLowerBound)
Description copied from interface: HIR
undecayExp Build an expression that undecay a pointer to a vector whose element type is pointed type.

Specified by:
undecayExp in interface HIR
Parameters:
pPointerExp - pointer expression pointing to the first element of the resultant vector.
pElemCount - Expression showing element count of the resultant vector.
pLowerBound - Expression showing the lower index bound of the resultant vector.
Returns:
the vector expression.

undecayExp

public Exp undecayExp(Exp pPointerExp,
                      long pElemCount)
Description copied from interface: HIR
undecayExp Build an expression that undecay a pointer to a vector whose element type is pointed type.

Specified by:
undecayExp in interface HIR
Parameters:
pPointerExp - pointer expression pointing to the first element of the resultant vector.
pElemCount - element count of the resultant vector.
Returns:
the vector expression.

undecayExp

public Exp undecayExp(Exp pPointerExp,
                      long pElemCount,
                      long pLowerBound)
Description copied from interface: HIR0
undecayExp Build an expression that undecay a pointer to a vector whose element type is pointed type.

Specified by:
undecayExp in interface HIR0
Parameters:
pPointerExp - pointer expression pointing to the first element of the resultant vector.
pElemCount - element count of the resultant vector.
pLowerBound - lower index bound of the resultant vector.
Returns:
the vector expression.

subscriptedExp

public SubscriptedExp subscriptedExp(Exp pArrayExp,
                                     Exp pSubscript)
Description copied from interface: HIR0
subscriptedExp Build a subscripted expression.

Specified by:
subscriptedExp in interface HIR0
Parameters:
pArrayExp - array expression to which subscript is to be attached; If multi-dimensional subscript is required, make pArrayExp as a subscripted variable and add more subscript by this method.
pSubscript - subscript expression.
Returns:
subscripted expression node having operation code subsCode.

subscriptedExp

public Exp subscriptedExp(Exp pArrayExp,
                          Exp pSubscript,
                          Exp pElemSize)
Description copied from interface: HIR
subscriptedExp Build an expression representing the indicated element of a vector whose element size is unfixed. If the size of the vector element is fixed and pElemSize is equal to it, then (subs pArrayExp pSubscript) is returned. If not, then a pointer expression representing the element located at the address addr(pArrayExp) + pElemSize * (pSubscript - lowerBound) is returned. As for vectors whose element size is constant or represented by an expression, use subscriptedExp( Exp pArrayExp, Exp pSubscript ) instead of this method.

Specified by:
subscriptedExp in interface HIR
Parameters:
pArrayExp - is array expression to which subscript is to be attached (it is unfixed size vector).
pSubscript - is subscript expression.
pElemSize - is the element size of pArrayExp in bytes.
Returns:
either subscripted expression node having operation code subsCode or pointer expression if the element type is unfixed-size.

qualifiedExp

public QualifiedExp qualifiedExp(Exp pStructUnionExp,
                                 ElemNode pElemNode)
Description copied from interface: HIR0
qualifiedExp Build a qualified expression.

Specified by:
qualifiedExp in interface HIR0
Parameters:
pStructUnionExp - expression specifying structure or union or region_variable to qualify.
pElemNode - An element of pStructUnionExp.
Returns:
qualified expression node having operation code qualCode.

pointedExp

public PointedExp pointedExp(Exp pStructUnionExp,
                             ElemNode pElemNode)
Description copied from interface: HIR0
pointedExp Build a pointed expression.

Specified by:
pointedExp in interface HIR0
Parameters:
pStructUnionExp - expression specifying structure or union whose element is to be pointed.
pElemNode - An element of pStructUnionExp.
Returns:
pointed expression node having operation code arrowCode.

contentsExp

public Exp contentsExp(Exp pPointerExp)
Description copied from interface: HIR0
contentsExp Build an expression that gets the contents pointed by pPointerExp.

Specified by:
contentsExp in interface HIR0
Parameters:
pPointerExp - Expression representing a pointer.
Returns:
the expression that gets the pointed expression.

convExp

public Exp convExp(Type pType,
                   Exp pExp)
Description copied from interface: HIR0
convExp Build an expression to convert the type of pExp to pType.

Specified by:
convExp in interface HIR0
Parameters:
pType - Type to which pExp is to be changed.
pExp - Expression to be converted.
Returns:
the expression converted to pType.

sizeofExp

public Exp sizeofExp(Type pType)
Description copied from interface: HIR0
sizeofExp Build the expression that get the size of pType.

Specified by:
sizeofExp in interface HIR0
Parameters:
pType - Type of object.
Returns:
the expression representing the size of pType.

sizeofExp

public Exp sizeofExp(Exp pExp)
Description copied from interface: HIR0
sizeofExp Build the expression that get the size of pExp.

Specified by:
sizeofExp in interface HIR0
Parameters:
pExp - Expression whose size is to be taken.
Returns:
the expression representing the size of pExp.

functionExp

public FunctionExp functionExp(Exp pFunctionSpec,
                               IrList pActualParamList)
Description copied from interface: HIR0
functionExp Build a function expression node that computes function value. The function may have no return value (void return value). If pFunctionSpec is (addr SubpNode) or SubpNode, then the subprogram represented by it is added to the call list of the current subprogram (symRoot.subpCurrent). The type of resultant expression is usually the type of return value, but type of pointed expression if pFunctionSpec is a pointer (to subprogram).

Specified by:
functionExp in interface HIR0
Parameters:
pFunctionSpec - function specification part which may be either a function name (SubpNode), or an expression specifying a function name ((addr SubpNode), etc.).
pActualParamList - actual parameter list (made by hirList).
Returns:
function expression node having operation code opCall.

addrExp

public Exp addrExp(Exp pExp)
Description copied from interface: HIR
addrExp Build addr expression representing the address of pExp. pExp should be l-value expression such as variable or SubpNode expression.

Specified by:
addrExp in interface HIR
Parameters:
pExp - l-value expression or SubpNode.
Returns:
the addr expression.

conditionalExp1

public Exp conditionalExp1(Exp pExp)

conditionalExp

public Exp conditionalExp(Exp pExp)
Description copied from interface: HIR
conditionalExp builds boolean expression to be used as conditional expression of IfStmt and LoopStmt. This will transform pExp to comparison expression if it is not so that conversion to LIR become easy.

Specified by:
conditionalExp in interface HIR
Parameters:
pExp - boolean expression.
Returns:
pExp if pExp is a comparison expression or return comparison expression transformed from pExp.

callStmt

public ExpStmt callStmt(Exp pSubpSpec,
                        IrList pActualParamList)
Description copied from interface: HIR0
callStmt Build a subprogram call statement. Parameters are the same as those of functionExp.

Specified by:
callStmt in interface HIR0
Parameters:
pSubpSpec - subprogram specification part which may be either a subprogram name (SubpNode), or an expression specifying a subprogram name ((addr SubpNode), etc.).
pActualParamList - actual parameter list (made by hirList).
Returns:
function expression node having operation code opCall.

assignStmt

public AssignStmt assignStmt(Exp pLeft,
                             Exp pRight)
Description copied from interface: HIR0
assignStmt Build an assignemnt statement.

Specified by:
assignStmt in interface HIR0
Parameters:
pLeft - left hand side (l-value) expression to which the value of expression is to be assigned.
pRight - expression (subtree) that is to be assigned to pLeftSide.
Returns:
the subtree of the built statement with statement body operator assignCode.

ifStmt

public IfStmt ifStmt(Exp pCondition,
                     Stmt pThenPart,
                     Stmt pElsePart)
Description copied from interface: HIR0
ifStmt Build an if-statement with then-part (pThenPart) and else-part (pElsePart). Internal labels (then-label and else-label) are generated to be attached to the then-part and else-part. If pThenPart or pElsePart is null, a LabeledStmt with null statement body is generated as then-part or else-part.

Specified by:
ifStmt in interface HIR0
Parameters:
pCondition - conditional expression subtree.
pThenPart - then-part statement that is executed when pCondition is true.
pElsePart - else-part statement that is executed when pCondition is false.
Returns:
the subtree of the built statement with statement body operator OP_IF; If else-part is not given, it is treated as null.

whileStmt

public WhileStmt whileStmt(Exp pCondition,
                           Stmt pLoopBody)
Specified by:
whileStmt in interface HIR0

whileStmt

public WhileStmt whileStmt(Label pLoopBackLabel,
                           Exp pCondition,
                           Stmt pLoopBody,
                           Label pLoopStepLabel,
                           Label pLoopEndLabel)
Description copied from interface: HIR
ifStmt Build an if-statement with then-part (pThenPart) and else-part (pElsePart). Internal labels (then-label and else-label) are generated to be attached to the then-part and else-part. If pThenPart or pElsePart is null, a LabeledStmt with null statement body is generated as then-part or else-part. (null else-part can be deleted by deleteUselessLabeledStmtOfHir() of coins.flow.DeleteUnusedLabels1.)

Specified by:
whileStmt in interface HIR
Parameters:
pCondition - conditional expression subtree.
Returns:
the subtree of the built statement with statement body operator OP_IF; If else-part is not given, it is treated as null.

forStmt

public ForStmt forStmt(Stmt pInitStmt,
                       Exp pCondition,
                       Stmt pLoopBody,
                       Stmt pStepPart)
Specified by:
forStmt in interface HIR0

forStmt

public ForStmt forStmt(Stmt pInitStmt,
                       Label pLoopBackLabel,
                       Exp pCondition,
                       Stmt pLoopBody,
                       Label pLoopStepLabel,
                       Stmt pStepPart,
                       Label pLoopEndLabel)
Specified by:
forStmt in interface HIR

repeatStmt

public RepeatStmt repeatStmt(Stmt pLoopBody,
                             Exp pCondition)
Specified by:
repeatStmt in interface HIR0

repeatStmt

public RepeatStmt repeatStmt(Label pLoopBackLabel,
                             Stmt pLoopBody,
                             Label pLoopStepLabel,
                             Exp pCondition,
                             Label pLoopEndLabel)
Specified by:
repeatStmt in interface HIR

indexedLoopStmt

public IndexedLoopStmt indexedLoopStmt(Var pLoopIndex,
                                       Exp pStartValue,
                                       Exp pEndValue,
                                       Exp pStepValue,
                                       Stmt pStmtBody)
Specified by:
indexedLoopStmt in interface HIR

indexedLoopStmt

public IndexedLoopStmt indexedLoopStmt(Var pLoopIndex,
                                       Exp pStartValue,
                                       Exp pEndValue,
                                       Exp pStepValue,
                                       boolean pUpward,
                                       Stmt pStmtBody)
Specified by:
indexedLoopStmt in interface HIR

labeledStmt

public LabeledStmt labeledStmt(Label pLabel,
                               Stmt pStmt)
Description copied from interface: HIR0
labeledStmt Build labeled statement using pLabel as its label and pStmt as its statement body. It is recommended to use attachLabel of Stmt except in HIR access methods to make a labeled statement. If you want to use labeledStmt, give null as pStmt parameter. Relations between pStmt and others (such as previousStmt, nextStmt, parentNode) are not kept. If it is necessary to transfer such relations to this LabeledStmt, apply attachLabel method to pStmt instead of calling labeledStmt.

Specified by:
labeledStmt in interface HIR0

blockStmt

public BlockStmt blockStmt(Stmt pStmtSequence)
Description copied from interface: HIR0
blockStmt Make an instance of block statement that may contain a sequence of statements. It is recommended to make an empty block statement by blockStmt(null) and then add statements by successively calling addLastStmt method of BlockStmt.

Specified by:
blockStmt in interface HIR0
Parameters:
pStmtSequence - statement to be included in BlockStmt (may be null).
Returns:
the resultant BlockStmt.

returnStmt

public ReturnStmt returnStmt(Exp pReturnValue)
Description copied from interface: HIR0
returnStmt Build return statement that terminates the execution of current subprogram under construction.

Specified by:
returnStmt in interface HIR0
Parameters:
pReturnValue - return value of function subprogram. If the subprogram has no return value, it is null.
Returns:
the subtree of the built statement with statement body operator OP_RETURN.

returnStmt

public ReturnStmt returnStmt()
Description copied from interface: HIR
returnStmt Build return statement that terminates the execution of current subprogram under construction. It has no return value.

Specified by:
returnStmt in interface HIR
Returns:
the subtree of the built statement with statement body operator OP_RETURN.

jumpStmt

public JumpStmt jumpStmt(Label pLabelSym)
Description copied from interface: HIR0
jumpStmt Create a jump statement and increment reference count of pLabelSym.

Specified by:
jumpStmt in interface HIR0
Parameters:
pLabelSym - jump target label.
Returns:
the created jump statement.

switchStmt

public SwitchStmt switchStmt(Exp pSelectExp,
                             IrList pJumpList,
                             Label pDefaultLabel,
                             Stmt pSwitchBody,
                             Label pEndLabel)
Description copied from interface: HIR0
switchStmt Make a SwitchStmt instance. The jump list pJumpList is a list of pairs of case constant and case label. Following sequence may create a jump list: created an empty list by irList() of HIR; generate a case-label and attach it to the statement corresponding to the case-constant; add hir.hirSeq(case-constant node, case-label node) to the list; repeat the generation of case-label and addition to the jump list;

Specified by:
switchStmt in interface HIR0
Parameters:
pSelectExp - Expression to select case statement.
pJumpList - Jump list that correlate case constant and case label.
pDefaultLabel - label to be attached to default statement part.
pSwitchBody - Switch statement body that contains statements with case-label.
pEndLabel - Label as the target of jump corresponding to break.
Returns:
the resultant SwitchStmt.

expStmt

public ExpStmt expStmt(Exp pExp)
Description copied from interface: HIR0
expStmt Create a statement treating pExp as a statement. ExpStmt appears as loop-condition, call statement, etc. The loop-condition is an expression but it has label, and so, it should be ExpStmt. The call statement is a function call expression treated as a stand alone statement, and so, it should be ExpStmt. It also certificates the value of getHirPosition() for labels. //##60

Specified by:
expStmt in interface HIR0
Parameters:
pExp - expression to be treated as a statement.
Returns:
the resultant ExpStmt.

nullStmt

public Stmt nullStmt()
Description copied from interface: HIR
nullStmt Make a statement having NullNode as its statement body.

Specified by:
nullStmt in interface HIR
Returns:
the null statement.

phiExp

public PhiExp phiExp(Var pVar,
                     Label pLabel)
Description copied from interface: HIR
phiExp Make a phi expression used in SSA.

Specified by:
phiExp in interface HIR
Parameters:
pVar - variable to be selected.
pLabel - label attached to a basic block from which control tranfers.
Returns:
PhiExp.

hirSeq

public HirSeq hirSeq(HIR pChild1)
Description copied from interface: HIR
hirSeq Make an HirSeq node that have some definite number of children.

Specified by:
hirSeq in interface HIR
Parameters:
pChild1 - Child 1 HIR node.
Returns:
HirSeq with one child.

hirSeq

public HirSeq hirSeq(HIR pChild1,
                     HIR pChild2)
Description copied from interface: HIR0
hirSeq Make an HirSeq node that have some definite number of children. //##59 (See HIR interface for HirSeq with more than 2 children.)

Specified by:
hirSeq in interface HIR0
Parameters:
pChild1 - Child 1 HIR node.
pChild2 - Child 2 HIR node.
Returns:
HirSeq with 2 children.

hirSeq

public HirSeq hirSeq(HIR pChild1,
                     HIR pChild2,
                     HIR pChild3)
Description copied from interface: HIR
hirSeq Make an HirSeq node that have some definite number of children.

Specified by:
hirSeq in interface HIR
Parameters:
pChild1 - Child 1 HIR node.
pChild2 - Child 2 HIR node.
pChild3 - Child 3 HIR node.
Returns:
HirSeq with 3 children.

setDataStmt

public SetDataStmt setDataStmt(Exp pVariable,
                               Exp pValueExp)
Description copied from interface: HIR
setDataStmt Make the statement that sets initial value or a list of initial values (pValueExp) to a variable (pVariable). The value(s) may be set at loading time (ahead of execution time) depending on execution environment. pVariable is the name of a scalar variable, an array variable, or a structure variable. If pVariable is not a scalar variable, pValueExp may be a list expression generated by expListExp method or a repeat specification generated by expRepeat method. pVariable is an l-value expression that may be a qualified expression or an array element. The qualified expression may appear to set initial values to elements of RegionType variable. The array element may appear in HIR expressions corresponding to Fortran DATA statement. If pVariable is an instance of Var, then a copy of pValueExp is set as the initial value of pvariable in the symbol table. pValueExp or elements of pValueExp should be constant value. See get, getWithRepeat, set methods of ExpListExp.

Specified by:
setDataStmt in interface HIR
Parameters:
pVariable - Variable to which initial value is to be set.
pValueExp - Value or list of values to be set to pVariable.
Returns:
the statement representing initail value setting.

expList

public Exp expList(java.util.List pList)
Description copied from interface: HIR
expList Make an expression representing a list of expressions, that is, make an instance of ExpListExp. The resultant list can be treated as an instance of Exp. Its elements may be an expression made by expRepeat method.

Specified by:
expList in interface HIR
Parameters:
pList - list of expressions.
Returns:
expression list.

expRepeat

public Exp expRepeat(Exp pValue,
                     Exp pCount)
Description copied from interface: HIR
expRepeat Make an expression representing a list of expressions of the same value.

Specified by:
expRepeat in interface HIR
Parameters:
pValue - Expression representing a value to be repeated.
pCount - Specifies the number of repeat count.
Returns:
repetition specification.

asmStmt

public AsmStmt asmStmt(java.lang.String pInstructions,
                       HirList pActualParamList)
Description copied from interface: HIR
asmStmt Make a statement representing asm( formalParams, instructionList, actualParams ).

Specified by:
asmStmt in interface HIR
Parameters:
pInstructions - String representing formal parameters and sequence of instructions.
pActualParamList - List of variable nodes and arithmetic expressions representing actual parameters.
Returns:
instance of AsmStmt.

setChildren

public void setChildren(IR p1,
                        IR p2)
Specified by:
setChildren in interface HIR

setChildren

public void setChildren(IR p1,
                        IR p2,
                        IR p3)
Specified by:
setChildren in interface HIR

setChildren

public void setChildren(IR p1,
                        IR p2,
                        IR p3,
                        IR p4)

setChildren

public void setChildren(IR p1,
                        IR p2,
                        IR p3,
                        IR p4,
                        IR p5)

getType

public Type getType()
Description copied from interface: HIR0
getType Get the type attached to this node. The type is usually attached when node is built by HIR factory methods such as exp.

Specified by:
getType in interface HIR0
Returns:
the type attached to this node.

setType

public void setType(Type pType)
Description copied from interface: HIR
setType Attach a type to this node. When HIR node is created by HIR factory methods, its type is set in the factory methods so that it is unnecessary to call setType again.

Specified by:
setType in interface HIR
Parameters:
pType - type to be attached to this node; It should represent a proper type corresponding to the result of subtree represented by this node.

getNextStmt

public Stmt getNextStmt()
Description copied from interface: HIR0
getNextStmt Get statement next to this statement.

Specified by:
getNextStmt in interface HIR0
Returns:
the statement next to this statement if this is a statement; If this is not a statement, return null.

getNextNode

public HIR getNextNode()
getNextNode is not recommended to be used in traversing HIR subtree because it has high overhead. It is recommended to use next() of HirIterator. getNextNode is provided for the case where HirIterator can not be used (in such cases as modification of HIR takes place while traversing HIR or getting next node in ancestors). getNextNode returns the node next to this traversing HIR tree in depth first order. If this subtree has no next node, then ancestor node is searched. null nodes are skipped and if null is returned, it means there is no next node.

Returns:
the node next to this node.

getNextNodeSeeingAncestor

protected HIR getNextNodeSeeingAncestor(HIR pHir)

getFlag

public boolean getFlag(int pFlagNumber)
getFlag returns the value (true/false) of the flag indicated by pFlagNumber. setFlag sets the flag of specified number.

Specified by:
getFlag in interface HIR0
Parameters:
pFlagNumber - flag identification number.
Returns:
the value of the flag.

setFlag

public void setFlag(int pFlagNumber,
                    boolean pYesNo)
setFlag setFlag sets the flag of specified number.

Specified by:
setFlag in interface HIR0
Parameters:
pFlagNumber - flag identification number.
pYesNo - true or false to be set to the flag.

flagsAreAllFalse

public boolean flagsAreAllFalse()

getFlagBox

public FlagBox getFlagBox()
Description copied from interface: HIR0
getFlagBox Users are recommended to use getFlag( int pFlagNumber ) except when they understand the treatment of FlagBox in detail.

Specified by:
getFlagBox in interface HIR0
Returns:
the flag box attached to this node; null if flag box is not attached (no flag is set).

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
clone Override Object.clone in HIR.

Returns:
cloned HIR object.
Throws:
java.lang.CloneNotSupportedException

getClone

public IR getClone()
            throws java.lang.CloneNotSupportedException
Throws:
java.lang.CloneNotSupportedException

hirClone

public HIR hirClone()
Description copied from interface: HIR0
hirClone Make the clone of this node to get a clone in the situation where clone() can not be used directly.

Specified by:
hirClone in interface HIR0
Returns:
the clone of this node.

hirNodeClone

public HIR hirNodeClone()
Description copied from interface: HIR
Make a copy of this HIR node without copying children.

Specified by:
hirNodeClone in interface HIR
Returns:
the copy of this node with null children.

copyWithOperands

public HIR copyWithOperands()
Description copied from interface: HIR0
copyWithOperands
  Make a subtree that is the same to this subtree.
  (Labels are not renamed.)
  In general, a subtree represents the computation of
  an operation and also the computation of its operands.
  Flow information is invalid as for copied subtree and
  should be computed again if required.
  If the subtree contains labels, it is recommended to use
  copyWithOperandsChangingLabels. Note that, IfStmt, LoopStmt
  (for, while, until, etc.), SwitchStmt
  contain internal labels and it is recommended to use
  copyWithOperandsChangingLabels to the subtree that may contain
  these statements.
  "this" should be the root node of a subtree contained
  in a subprogram body. Subprogram body itself should not be copied.

Specified by:
copyWithOperands in interface HIR0
Returns:
the subtree made by the copy operation.

copyWithOperandsChangingLabels

public HIR copyWithOperandsChangingLabels(IrList pLabelCorrespondence)
copyWithOperandsChangingLabels Copy this subtree changing labels that are defined in this subtree to avoid label duplication.

Specified by:
copyWithOperandsChangingLabels in interface HIR0
Parameters:
pLabelCorrespondence - null if this method is called from outside HIR access methods. If it is null, it is computed in this method and passed to subclasses after copyWithOperands (without changing label).
Returns:
the subtree with labels changed.

isTree

protected boolean isTree(java.util.Set pVisitedNodes,
                         int pErrorCounter,
                         java.util.Set pSetOfLabels)
isTree Test if this does not violates tree structure, that is, detect node adherence in branches and handshake miss in parent-child relation. Issues message if some node is encountered twice in the process of traversing this subtree.

Parameters:
pVisitedNodes - Give null in usual case; Set of visited nodes is given when isTree is invoked recursively by isTree.
Returns:
true if this a tree else return false.

isTree

public boolean isTree()
Description copied from interface: HIR
isTree Test if this does not violates tree structure, that is, detect node adherence in branches and handshake miss in parent-child relation. Issues message if some node is encountered twice in the process of traversing this subtree. If there is duplicated label definition, then return false. //##60

Specified by:
isTree in interface HIR
Returns:
true if this a tree else return false.

isSameAs

public boolean isSameAs(HIR pTree)
isSameAs Compare this tree with pTree and if they have the same tree shape (same operator and same operands) then return true. In the comparison, attributes are not compared. (This method is public but less efficient than the protected method isSameTree in flow.HirSubpFlowImpl.)

Specified by:
isSameAs in interface HIR0
Parameters:
pTree - HIR tree to be compared.
Returns:
true if this tree has the same shape as pTree, false otherwise.

checkLinkage

public void checkLinkage(java.lang.String pHeader)
Description copied from interface: HIR
Check parent-child linkage if debug level (ioRoot.dbgHir.getLevel()) is greater than 0. If the linkage is incorrect, issue message.

Specified by:
checkLinkage in interface HIR
Parameters:
pHeader - name of HIR modification operation.

subpIterator

public java.util.Iterator subpIterator()
Description copied from interface: HIR
subpIterator Make an iterator that traverses all subprogram definitions in the current compile unit. Sequence of SubpDefinition will be get by using next() of the iterator successively.

Specified by:
subpIterator in interface HIR
Returns:
the iterator to traverse subprogram definitions.

hirIterator

public HirIterator hirIterator(IR pSubtree)
Description copied from interface: HIR0
hirIterator
  Get an iterator to traverse all nodes or statements under
  pSubtree. YOu can traverse the subtree by following methods
  of HirIterator
     next(): traverse all nodes.
     getNextStmt(): traverse all statements.
     getNextExecutableNode(): traverse executable nodes only.
  See HirIterator interface.
 

Specified by:
hirIterator in interface HIR0
Parameters:
pSubtree - root of the subtree to be traversed.
Returns:
teh resultant HirIterator.

accept

public void accept(HirVisitor pVisitor)
Description copied from interface: HIR0
accept Acceptor used in HIR visitor. See HirVisitor, HirVisitorModel1, HirVisitormodel2.

Specified by:
accept in interface HIR0
Parameters:
pVisitor - HirVisitor