private boolean rContainsRMInstruction(ProgramBlock pb,String varName){
  if (pb instanceof WhileProgramBlock) {
    WhileProgramBlock tmp=(WhileProgramBlock)pb;
    for (    ProgramBlock c : tmp.getChildBlocks())     if (rContainsRMInstruction(c,varName))     return true;
  }
 else   if (pb instanceof IfProgramBlock) {
    IfProgramBlock tmp=(IfProgramBlock)pb;
    for (    ProgramBlock c : tmp.getChildBlocksIfBody())     if (rContainsRMInstruction(c,varName))     return true;
    for (    ProgramBlock c : tmp.getChildBlocksElseBody())     if (rContainsRMInstruction(c,varName))     return true;
  }
 else   if (pb instanceof ForProgramBlock) {
    ForProgramBlock tmp=(ForProgramBlock)pb;
    for (    ProgramBlock c : tmp.getChildBlocks())     if (rContainsRMInstruction(c,varName))     return true;
  }
 else   if (pb instanceof FunctionProgramBlock) {
  }
 else {
    for (    Instruction inst : pb.getInstructions()) {
      String instStr=inst.toString();
      if (instStr.contains("rmfilevar" + Lop.OPERAND_DELIMITOR + varName) || instStr.contains("rmvar" + Lop.OPERAND_DELIMITOR + varName)) {
        return true;
      }
    }
  }
  return false;
}

private boolean rContainsRMInstruction ( ProgramBlock pb , String varName ) { if ( pb instanceof WhileProgramBlock ) { WhileProgramBlock tmp = ( WhileProgramBlock ) pb ; for ( ProgramBlock c : tmp . getChildBlocks ( ) ) if ( rContainsRMInstruction ( c , varName ) ) return true ; } else if ( pb instanceof IfProgramBlock ) { IfProgramBlock tmp = ( IfProgramBlock ) pb ; for ( ProgramBlock c : tmp . getChildBlocksIfBody ( ) ) if ( rContainsRMInstruction ( c , varName ) ) return true ; for ( ProgramBlock c : tmp . getChildBlocksElseBody ( ) ) if ( rContainsRMInstruction ( c , varName ) ) return true ; } else if ( pb instanceof ForProgramBlock ) { ForProgramBlock tmp = ( ForProgramBlock ) pb ; for ( ProgramBlock c : tmp . getChildBlocks ( ) ) if ( rContainsRMInstruction ( c , varName ) ) return true ; } else if ( pb instanceof FunctionProgramBlock ) { } else { for ( Instruction inst : pb . getInstructions ( ) ) { String instStr = inst . toString ( ) ; if ( instStr . contains ( "rmfilevar" + Lop . OPERAND_DELIMITOR + varName ) || instStr . contains ( "rmvar" + Lop . OPERAND_DELIMITOR + varName ) ) { return true ; } } } return false ; }
determines if the given program block includes a rmvar or rmfilevar instruction for the given varname .
