break;
}
case Statement.TYPE_IF:
{
IfStatement ifStmt = (IfStatement)statement;
Program ifProgram = planBlock(parentProcCommand, ifStmt.getIfBlock(), metadata, debug, idGenerator, capFinder, analysisRecord, context);
Program elseProgram = null;
if(ifStmt.hasElseBlock()) {
elseProgram = planBlock(parentProcCommand, ifStmt.getElseBlock(), metadata, debug, idGenerator, capFinder, analysisRecord, context);
}
instruction = new IfInstruction(ifStmt.getCondition(), ifProgram, elseProgram);
if(debug) {
analysisRecord.println("\tIF STATEMENT:\n" + statement); //$NON-NLS-1$
}
break;
}
case Statement.TYPE_BREAK:
{
if(debug) {
analysisRecord.println("\tBREAK STATEMENT:\n" + statement); //$NON-NLS-1$
}
instruction = new BreakInstruction();
break;
}
case Statement.TYPE_CONTINUE:
{
if(debug) {
analysisRecord.println("\tCONTINUE STATEMENT:\n" + statement); //$NON-NLS-1$
}
instruction = new ContinueInstruction();
break;
}
case Statement.TYPE_LOOP:
{
LoopStatement loopStmt = (LoopStatement)statement;
if(debug) {
analysisRecord.println("\tLOOP STATEMENT:\n" + statement); //$NON-NLS-1$
}
String rsName = loopStmt.getCursorName();
ProcessorPlan commandPlan = loopStmt.getCommand().getProcessorPlan();
Program loopProgram = planBlock(parentProcCommand, loopStmt.getBlock(), metadata, debug, idGenerator, capFinder, analysisRecord, context);
instruction = new LoopInstruction(loopProgram, rsName, commandPlan);
break;
}
case Statement.TYPE_WHILE:
{
WhileStatement whileStmt = (WhileStatement)statement;
Program whileProgram = planBlock(parentProcCommand, whileStmt.getBlock(), metadata, debug, idGenerator, capFinder, analysisRecord, context);
if(debug) {
analysisRecord.println("\tWHILE STATEMENT:\n" + statement); //$NON-NLS-1$
}
instruction = new WhileInstruction(whileProgram, whileStmt.getCondition());
break;