coins.ir.hir
Class LoopStmtImpl

java.lang.Object
  extended bycoins.ir.hir.HIR_Impl
      extended bycoins.ir.hir.StmtImpl
          extended bycoins.ir.hir.LoopStmtImpl
All Implemented Interfaces:
java.lang.Cloneable, HasStringObject, HIR, HIR0, IR, IR0, LoopStmt, Stmt
Direct Known Subclasses:
ForStmtImpl, IndexedLoopStmtImpl, RepeatStmtImpl, UntilStmtImpl, WhileStmtImpl

public abstract class LoopStmtImpl
extends StmtImpl
implements LoopStmt

  Loop-statement class.
// Components (children) of loop statement
//   child1: LoopInitPart. (Stmt)
//           This may be null.
//           getLoopInitPart returns this statement.
//   child2: ConditionalInitPart (This has been deleted. Give null.)
//           This is executed only once if loop condition is satisfied.
//           (At present, this is implemented by if-stmt attached to
//            LoopInitPart so that hir2lir has no need of
//            special treatment.)
//   child3: StartConditionPart with loopBackLabel. (LabeledStmt)
//           This should be given but its LabeledStmt may be null.
//           getLoopBackPoint() returns this LabeledStmt.
//   child4: LoopBody that is a LabeledStmt with loopBodyLabel.
//           StmtBody part of the LabeledStmt is BlockStmt
//           having LabeledStmt with loopStepLabel (LabeledStmt)
//           as the last statement of the loop-body BlockStmt.
//           An implementation of the LoopBody is
//           (labeledStmt
//            (list )
//            (block
//             sequence of statements given as pLoopBody parameter
//               of setChildrenOfLoop
//             (labeledStmt
//              (list )
//              null)))
//           LoopBody should be given but its BlockStmt may have
//           no executable statements.
//           getLoopBodyPart() returns this LabeledStmt.
//   child5: EndCondition.  (ExpStmt)
//           This may be null.
//           getLoopEndCondition() returns the expression of the ExpStmt.
//   child6: LoopStepPart jumping to loopBackLabel. (Stmt)
//           This may be null.
//           getLoopStepPart() returns this statement.
//   child7: LoopEndpart with loopEndLabel. (LabeledStmt)
//           This should be given but its LabeledStmt may be null.
//           getLoopEndPart() returns this LabeledStmt.


Field Summary
 Label fLoopBackLabel
           
 Label fLoopEndLabel
           
(package private)  LoopInf fLoopInf
           
 Label fLoopStepLabel
           
 
Fields inherited from class coins.ir.hir.StmtImpl
fMultiBlock, fNextStmt, fPrevStmt
 
Fields inherited from class coins.ir.hir.HIR_Impl
fAdditionalChild, fChildCount, fChildNode1, fChildNode2, fDbgLevel, fHirAnnex, fOperator, fParentNode, fType, hirRoot, inversionTable, machineParam, 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
LoopStmtImpl()
           
LoopStmtImpl(HirRoot pHirRoot)
           
 
Method Summary
 void accept(HirVisitor pVisitor)
          accept Acceptor used in HIR visitor.
 void addToConditionalInitPart(Stmt pStmt)
          addToConditionalInitPart
 void addToLoopBodyPart(Stmt pStmt)
          Add the statement pStmt before the step-labeled statement (as the last statement except the null statement with the loop-step label).
 void addToLoopEndPart(Stmt pStmt)
          Add pStmt as the statement next to the existing loop-end statement.
 void addToLoopInitPart(Stmt pStmt)
          Add pStmt as the last statement of loop-init-part.
 void addToLoopStepPart(Stmt pStmt)
          Add the statement pStmt to the loop-step part (add as the statement next to the existing statement of the loop-step part).
 java.lang.Object clone()
          clone Override Object.clone in HIR.
 void combineWithConditionalExp(Stmt pStmt, HIR pCond)
          Combine pStmt with conditional expression part pCond of control statement so that pStmt should be executed before pCond.
 BlockStmt getConditionalInitPart()
          getConditionalInitPart Get the BlockStmt containing the statements added by addToConditionalInitPart.
 Stmt getConditionalInitPart2()
           
 Label getLoopBackLabel()
           
 LabeledStmt getLoopBackPoint()
          getLoopBackPoint Get the statement with loopBackLabel.
 Label getLoopBodyLabel()
           
 Stmt getLoopBodyPart()
          getLoopBodyPart
 Exp getLoopEndCondition()
          getLoopEndCondition
 Label getLoopEndLabel()
           
 LabeledStmt getLoopEndPart()
          getLoopEndPart
 LoopInf getLoopInf()
          This method is not used anymore.
 Stmt getLoopInitPart()
           Get the loop initiation part that is executed before repetition.
 Exp getLoopStartCondition()
          getLoopStartCondition
 Label getLoopStepLabel()
           
 Stmt getLoopStepPart()
          getLoopStepPart
 boolean isLoopStmt()
           
 boolean isSimpleForLoop()
          isSimpleForLoop
 boolean isSimpleIndexedLoop()
          isSimpleIndexedLoop
 boolean isSimpleRepeatLoop()
          isSimpleRepeatLoop
 boolean isSimpleUntilLoop()
           
 boolean isSimpleWhileLoop()
          isSimpleWhileLoop
protected  Stmt makeConditionalInitPart(Exp pStartCondition, Stmt pConditionalInitPart)
           
 void replaceBodyPart(LabeledStmt pNewStmt)
          Replace the loop body with pNewStmt.
 void replaceConditionalInitPart(LabeledStmt pNewStmt)
           
 void setChildrenOfLoop(Stmt pInitPart, Label pLoopBackLabel, Stmt pConditionalInitPart, Exp pStartCondition, Stmt pLoopBody, Label pLoopStepLabel, Exp pEndCondition, Stmt pLoopStepPart, Label pLoopEndLabel, Stmt pLoopEndPart)
           
 void setLoopEndCondition(Exp pCondition)
          Set the expression pCondition as the loop-end condition expression.
 void setLoopInf(LoopInf pLoopInf)
          This method is not used anymore.
 void setLoopStartCondition(Exp pCondition)
          Set the expression pCondition as the loop-start condition expression.
 
Methods inherited from class coins.ir.hir.StmtImpl
addNextStmt, addNextStmt, adjustMultiBlockFlag, adjustMultiBlockFlag, ancestorControlStmtOfConditionalExp, attachLabel, attachLabelAsFirstOne, backTraceLabeledStmt, combineStmt, copyPosition, cutLabelLinkOfStmt, deleteNextStmt, deletePreviousStmt, deleteThisStmt, getBlockStmt, getFileName, getLabel, getLabelDefList, getLabeledStmt, getLineNumber, getNextStmt, getPreviousStmt, getStmtWithLabel, getUpperStmt, insertPreviousStmt, insertPreviousStmt, isBranchStmt, isMultiBlock, isolateThisStmt, printLinkage, replaceThisStmtWith, setFileName, setLineNumber, toStringDetail, traceFirstStmt, traceLastStmt
 
Methods inherited from class coins.ir.hir.HIR_Impl
addInf, addrExp, asmStmt, assignStmt, blockStmt, callStmt, checkLinkage, conditionalExp, conditionalExp1, constNode, contains, contentsExp, convExp, copyInfListFrom, copyWithOperands, copyWithOperandsChangingLabels, cutParentLink, cutParentLink, decayExp, elemNode, exp, exp, exp, expList, expRepeat, expStmt, falseNode, fatalError, finishHir, flagsAreAllFalse, forStmt, forStmt, functionExp, getChild, getChild1, getChild2, getChildCount, getChildNumber, getClone, getExpId, getFlag, getFlagBox, getFlowAnalSym, getIndentSpace, getIndex, getInf, getInfList, getInfString, getIrName, getNextNode, getNextNodeSeeingAncestor, getOperator, getParent, getResultOperand, getResultVar, getSourceNode, getSourceNode1, getSourceNode2, getStmtContainingThisNode, getSym, getSymOrExpId, getType, getWork, hirClone, hirIterator, hirList, hirNodeClone, hirSeq, hirSeq, hirSeq, ifStmt, indexedLoopStmt, indexedLoopStmt, infStmt, infStmt, intConstNode, intConstNode, irList, irList, isEmpty, isHIR, isLIR, isSameAs, isStmt, isSym, isTerminal, isTree, isTree, jumpStmt, labelDef, labeledStmt, labelNode, nullNode, nullStmt, offsetConstNode, phiExp, pointedExp, print, print, program, qualifiedExp, removeInf, repeatStmt, repeatStmt, replaceOperator, replaceResultOperand, replaceResultVar, replaceSource, replaceSource1, replaceSource2, replaceThisNode, returnStmt, returnStmt, setChild, setChild1, setChild2, setChildren, setChildren, setChildren, setChildren, setDataStmt, setFlag, setIndex, setIndexNumberToAllNodes, setIndexNumberToAllNodes, setIndexNumberToAllNodes2, setParameters, setParent, setType, setWork, severeError, sizeofExp, sizeofExp, slightError, subpDefinition, subpDefinition, subpDefinition, subpIterator, subpNode, subscriptedExp, subscriptedExp, switchStmt, symNode, toString, toStringShort, toStringWithChildren, trueNode, typeNode, undecayExp, undecayExp, undecayExp, undecayExp, varNode, warinig, whileStmt, whileStmt, withInf
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface coins.ir.hir.Stmt
addNextStmt, ancestorControlStmtOfConditionalExp, attachLabel, attachLabelAsFirstOne, combineStmt, copyPosition, cutLabelLinkOfStmt, deleteThisStmt, getBlockStmt, getFileName, getLabel, getLabelDefList, getLabeledStmt, getLineNumber, getPreviousStmt, getUpperStmt, insertPreviousStmt, insertPreviousStmt, isBranchStmt, isMultiBlock, isolateThisStmt, replaceThisStmtWith, setFileName, setLineNumber
 
Methods inherited from interface coins.ir.hir.HIR
addrExp, asmStmt, checkLinkage, conditionalExp, contains, copyInfListFrom, cutParentLink, exp, expList, expRepeat, forStmt, getExpId, getFlowAnalSym, getIndentSpace, getInfString, getIrName, getSourceNode, getSourceNode1, getSourceNode2, getSymOrExpId, getWork, hirNodeClone, hirSeq, hirSeq, indexedLoopStmt, indexedLoopStmt, infStmt, infStmt, intConstNode, irList, isEmpty, isStmt, isTree, nullNode, nullStmt, offsetConstNode, phiExp, repeatStmt, replaceSource, replaceSource1, replaceSource2, returnStmt, setChild1, setChild2, setChildren, setChildren, setDataStmt, setIndex, setIndexNumberToAllNodes, setParent, setType, setWork, subpDefinition, subpIterator, subscriptedExp, toString, toStringDetail, toStringShort, toStringWithChildren, undecayExp, undecayExp, undecayExp, whileStmt
 
Methods inherited from interface coins.ir.IR
addInf, getChild1, getChild2, getInf, getInfList, getParent, getSym, print, print, removeInf
 
Methods inherited from interface coins.ir.IR0
getChild, getChildCount, getIndex, getOperator, setChild
 
Methods inherited from interface coins.ir.hir.HIR0
assignStmt, blockStmt, callStmt, constNode, contentsExp, convExp, copyWithOperands, copyWithOperandsChangingLabels, decayExp, elemNode, exp, exp, expStmt, falseNode, finishHir, forStmt, functionExp, getChildNumber, getFlag, getFlagBox, getNextStmt, getStmtContainingThisNode, getType, hirClone, hirIterator, hirList, hirSeq, ifStmt, intConstNode, irList, isSameAs, jumpStmt, labelDef, labeledStmt, labelNode, pointedExp, print, program, qualifiedExp, repeatStmt, replaceThisNode, returnStmt, setFlag, setIndexNumberToAllNodes, sizeofExp, sizeofExp, subpDefinition, subpNode, subscriptedExp, switchStmt, symNode, trueNode, undecayExp, varNode, whileStmt
 

Field Detail

fLoopBackLabel

public Label fLoopBackLabel

fLoopStepLabel

public Label fLoopStepLabel

fLoopEndLabel

public Label fLoopEndLabel

fLoopInf

LoopInf fLoopInf
Constructor Detail

LoopStmtImpl

public LoopStmtImpl()

LoopStmtImpl

public LoopStmtImpl(HirRoot pHirRoot)
Method Detail

setChildrenOfLoop

public void setChildrenOfLoop(Stmt pInitPart,
                              Label pLoopBackLabel,
                              Stmt pConditionalInitPart,
                              Exp pStartCondition,
                              Stmt pLoopBody,
                              Label pLoopStepLabel,
                              Exp pEndCondition,
                              Stmt pLoopStepPart,
                              Label pLoopEndLabel,
                              Stmt pLoopEndPart)

getLoopInitPart

public Stmt getLoopInitPart()
Description copied from interface: LoopStmt
 Get the loop initiation part that is executed before
 repetition.
 Ex.
 For a loop statement
   for (i=0; i

Specified by:
getLoopInitPart in interface LoopStmt
Returns:
the loop initiation part;

getConditionalInitPart

public BlockStmt getConditionalInitPart()
Description copied from interface: LoopStmt
getConditionalInitPart Get the BlockStmt containing the statements added by addToConditionalInitPart. If there is no such statements, then return null.

Specified by:
getConditionalInitPart in interface LoopStmt
Returns:
ConditionalInitBlock containing statements added by addToConditionalInitPart.

getConditionalInitPart2

public Stmt getConditionalInitPart2()

getLoopStartCondition

public Exp getLoopStartCondition()
Description copied from interface: LoopStmt
getLoopStartCondition
 Get the loop start conditional expression that has
 the loopBackLabel.
 For a loop statement
   for (i=0; i

Specified by:
getLoopStartCondition in interface LoopStmt
Returns:
the loop start condition expression.

getLoopBackPoint

public LabeledStmt getLoopBackPoint()
Description copied from interface: LoopStmt
getLoopBackPoint Get the statement with loopBackLabel. Even empty loop has a LabeledStmt with loopBackLabel where its statement body may be null.

Specified by:
getLoopBackPoint in interface LoopStmt
Returns:
the statement with loopBackLabel.

getLoopBodyPart

public Stmt getLoopBodyPart()
Description copied from interface: LoopStmt
getLoopBodyPart
 Get the loop body that is repetitively executed.
 It is a block statement (BlockStmt)
 with loop start label and the blcok
 statement contains a labeled statement.
 with loopStepLabel as its last statement.
 For a statement
   for (i = 0; i < 10; i++)
     a[i] = 0;
 a labeled statement
   _lab6: { a[i] = 0; }
 will be returned where _lab6 is a loop start label
 generated by the compiler.
 For a statement
   while (i < 10) {
     a = a + b;
     if (a >= 10) {
       i = i + 1;
       continue;
     }
     i = i + 1;
   }
 a labeled statement
   _lab10: {
     a = a + b;
     if (a >= 10) {
       i = i + 1;
       goto _lab3;
     }
     i = i + 1;
     _lab4:
   }
 will be returned where _lab10 is the loop start label
 and _lab4 is the loop step label generated by the compiler.

Specified by:
getLoopBodyPart in interface LoopStmt
Returns:
the loop body that is repetitively executed.

getLoopEndCondition

public Exp getLoopEndCondition()
Description copied from interface: LoopStmt
getLoopEndCondition
 Get the loop end conditional expression.
 For a loop statement
   do { ... }
   while (i>0);
 the expression i>0 is returned.
 For a loop statement
   for (i=0; i

Specified by:
getLoopEndCondition in interface LoopStmt
Returns:
the loop end condition expression.

getLoopStepPart

public Stmt getLoopStepPart()
Description copied from interface: LoopStmt
getLoopStepPart
 Get the loop step part that is executed before
 jumping to loopBackLabel.
 For a loop statement
   for (i=0; i

Specified by:
getLoopStepPart in interface LoopStmt
Returns:
the loop step part.

getLoopEndPart

public LabeledStmt getLoopEndPart()
Description copied from interface: LoopStmt
getLoopEndPart
 Get the loop end part having the loopEndLabel.
 For a loop statement
   for (i=0; i

Specified by:
getLoopEndPart in interface LoopStmt
Returns:
the loop end part having the loopEndLabel.

getLoopBackLabel

public Label getLoopBackLabel()
Specified by:
getLoopBackLabel in interface LoopStmt
Returns:
the loopBacklabel thet is attached to loop start condition part.

getLoopBodyLabel

public Label getLoopBodyLabel()
Specified by:
getLoopBodyLabel in interface LoopStmt
Returns:
return the loopBodyLabel that is attached to the loop body repetitively executed.

getLoopStepLabel

public Label getLoopStepLabel()
Specified by:
getLoopStepLabel in interface LoopStmt
Returns:
the loopStepLabel that is attached to a null stetement placed as the last statement in the loop body part and before the loop step part.

getLoopEndLabel

public Label getLoopEndLabel()
Specified by:
getLoopEndLabel in interface LoopStmt
Returns:
the loopEndLabel that is attached to a (usually null) statement located at the end of the loop.

getLoopInf

public LoopInf getLoopInf()
Description copied from interface: LoopStmt
This method is not used anymore. (lparallel uses LoopInfo of lparallel.)

Specified by:
getLoopInf in interface LoopStmt
Returns:
the LoopInf.

setLoopInf

public void setLoopInf(LoopInf pLoopInf)
Description copied from interface: LoopStmt
This method is not used anymore.

Specified by:
setLoopInf in interface LoopStmt

addToLoopInitPart

public void addToLoopInitPart(Stmt pStmt)
Description copied from interface: LoopStmt
Add pStmt as the last statement of loop-init-part. If there is no loop-init-part, then pStmt is attached as the new loop-init-part. If there is already loop-init-part, then pStmt is added as the last statement of the loop-init-part.

Specified by:
addToLoopInitPart in interface LoopStmt
Parameters:
pStmt - statement to be added to loop-init-part.

addToConditionalInitPart

public void addToConditionalInitPart(Stmt pStmt)
Description copied from interface: LoopStmt
addToConditionalInitPart
 ConditionalInitPart is executed once if the LoopStartCondition
 is satisfied. It is a block to where loop invariant expressions
 are to be moved so that they are executed only once. The
 ConditionalInitPart is created by addToConditionalInitPart(pStmt)
 as a block containing ConditionalInitBlock in the LoopInitPart
 in the following way:
 Case 1: LoopStartCondition is null:
   LoopInitPart_ is changed as follows:
     {
       oroginal LoopInitPart_;
       { // ConditionalInitBlock.
         // getConditionalInitPart() returns this else-block.
         Sequence of statements added by addToConditionalInitPart;
       }
     }
   The transformation procedure is:
     If ConditionalInitBlock is not yet created,
       create it as a BlockStmt and add it as the last statement
       of LoopInitBlock
     pStmt is added as the last statement of ConditionalInitBlock.
 case 2:  LoopStartCondition is not null and ConditionalInitPart
          is not yet created:
   LoopInitPart_ is changed as follows:
     {
       oroginal LoopInitPart_;
       if (loopStartConditionExpression == false) {
         jump to loopEndLabel;
       }else { // ConditionalInitBlock.
               // getConditionalInitPart() returns this else-block.
         Sequence of statements added by addToConditionalInitPart;
         jump to loopBodyLabel;
       }
     }

   The else-part of above if-statement is called as
   ConditionalInitBlock.
 case 3: ConditionalInitBlock is already created:
   pStmt is inserted before "goto loopBodyLabel" of ConditionalInitBlock.
 Expressions to be executed only once for this loop
 may be added to ConditionalInitBlock by calling
 addToConditionalInitPart successively.
 When ConditionalInitBlock with "jump to loopBodyLabel" is created,
   setFlag(HIR.FLAG_LOOP_WITH_CONDITIONAL_INIT, true)
 is executed to show that the loop became irreducible but
 it is a tame loop that can be treated in many optimization/
 parallelization procedures.
 No special treatment is required for ConditionalInitPart in
 HIR-to-LIR conversion, HIR-to-C conversion, HIR flow analysis,
 etc. because it takes a form of normal HIR expression.

Specified by:
addToConditionalInitPart in interface LoopStmt

makeConditionalInitPart

protected Stmt makeConditionalInitPart(Exp pStartCondition,
                                       Stmt pConditionalInitPart)

addToLoopBodyPart

public void addToLoopBodyPart(Stmt pStmt)
Description copied from interface: LoopStmt
Add the statement pStmt before the step-labeled statement (as the last statement except the null statement with the loop-step label).

Specified by:
addToLoopBodyPart in interface LoopStmt
Parameters:
pStmt - statement to be added to the boop body.

addToLoopStepPart

public void addToLoopStepPart(Stmt pStmt)
Description copied from interface: LoopStmt
Add the statement pStmt to the loop-step part (add as the statement next to the existing statement of the loop-step part).

Specified by:
addToLoopStepPart in interface LoopStmt
Parameters:
pStmt - statement to be added to the loop-step part.

addToLoopEndPart

public void addToLoopEndPart(Stmt pStmt)
Description copied from interface: LoopStmt
Add pStmt as the statement next to the existing loop-end statement.

Specified by:
addToLoopEndPart in interface LoopStmt
Parameters:
pStmt - statement to be added to the loop-end part.

setLoopStartCondition

public void setLoopStartCondition(Exp pCondition)
Description copied from interface: LoopStmt
Set the expression pCondition as the loop-start condition expression.

Specified by:
setLoopStartCondition in interface LoopStmt
Parameters:
pCondition - expression to be set.

setLoopEndCondition

public void setLoopEndCondition(Exp pCondition)
Description copied from interface: LoopStmt
Set the expression pCondition as the loop-end condition expression.

Specified by:
setLoopEndCondition in interface LoopStmt
Parameters:
pCondition - expression to be set.

replaceConditionalInitPart

public void replaceConditionalInitPart(LabeledStmt pNewStmt)
                                throws CompileError
Throws:
CompileError

replaceBodyPart

public void replaceBodyPart(LabeledStmt pNewStmt)
Description copied from interface: LoopStmt
Replace the loop body with pNewStmt.

Specified by:
replaceBodyPart in interface LoopStmt
Parameters:
pNewStmt - statement to be set as the new loop body statement.

isSimpleForLoop

public boolean isSimpleForLoop()
Description copied from interface: LoopStmt
isSimpleForLoop
  Check if this is a simple for loop, that is,
    an instance of ForStmt and
    conditional init part is null and
    loop end condition is null.

Specified by:
isSimpleForLoop in interface LoopStmt
Returns:
true if above conditions are satisfied, else return false.

isSimpleWhileLoop

public boolean isSimpleWhileLoop()
Description copied from interface: LoopStmt
isSimpleWhileLoop
  Check if this is a simple while loop, that is,
    an instance of WhileStmt and
    conditional init part is null and
    loop step part is null and
    loop end condition is null.

Specified by:
isSimpleWhileLoop in interface LoopStmt
Returns:
true if above conditions are satisfied, else return false.

isSimpleRepeatLoop

public boolean isSimpleRepeatLoop()
Description copied from interface: LoopStmt
isSimpleRepeatLoop
  Check if this is a simple repeat-while-true loop, that is,
    an instance of RepeatStmt and
    conditional init part is null and
    loop start condition is null and
    loop step part is null.

Specified by:
isSimpleRepeatLoop in interface LoopStmt
Returns:
true if above conditions are satisfied, else return false.

isSimpleUntilLoop

public boolean isSimpleUntilLoop()

isSimpleIndexedLoop

public boolean isSimpleIndexedLoop()
Description copied from interface: LoopStmt
isSimpleIndexedLoop
  Check if this is a simple indexed loop, that is,
    an instance of IndexedLoopStmt and
    conditional init part is null and
    loop end condition is null.

Specified by:
isSimpleIndexedLoop in interface LoopStmt
Returns:
true if above conditions are satisfied, else return false.

isLoopStmt

public boolean isLoopStmt()
Overrides:
isLoopStmt in class StmtImpl

combineWithConditionalExp

public void combineWithConditionalExp(Stmt pStmt,
                                      HIR pCond)
Combine pStmt with conditional expression part pCond of control statement so that pStmt should be executed before pCond.

Specified by:
combineWithConditionalExp in interface Stmt
Overrides:
combineWithConditionalExp in class StmtImpl
Parameters:
pStmt - statement to be executed before pCond.
pCond - conditional expression to be combined with pStmt.

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Description copied from class: HIR_Impl
clone Override Object.clone in HIR.

Overrides:
clone in class StmtImpl
Throws:
java.lang.CloneNotSupportedException

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
Overrides:
accept in class HIR_Impl