// plan each statement in the block
for (Statement statement : block.getStatements()) {
Object instruction = planStatement(parentProcCommand, statement, metadata, debug, idGenerator, capFinder, analysisRecord, context);
if(instruction instanceof ProgramInstruction){
programBlock.addInstruction((ProgramInstruction)instruction);
}else{
//an array of ProgramInstruction
ProgramInstruction[] insts = (ProgramInstruction[])instruction;
for(int i=0; i<insts.length; i++){
programBlock.addInstruction(insts[i]);