switch(tf.getAnalysisDirection()) {
case FORWARD_ANALYSIS:
if(!afterResult && targetInstr == this)
return LabeledSingleResult.createResult(value, normalOnly);
for(int i = 0; i < instructions.length-1; i++) {
TACInstruction instr = instructions[i];
if(!afterResult && instr == targetInstr)
return LabeledSingleResult.createResult(value, normalOnly);
IResult<LE> result = instr.transfer(tf, normalOnly, value);
if(afterResult && instr == targetInstr)
return result;
value = result.get(normal);
}
TACInstruction last = instructions[instructions.length-1];
if(!afterResult && last == targetInstr)
return LabeledSingleResult.createResult(value, normalOnly);
else if(afterResult && (last == targetInstr || this == targetInstr))
return last.transfer(tf, labels, value);
else
break;
case BACKWARD_ANALYSIS:
if(afterResult && targetInstr == this)
return LabeledSingleResult.createResult(value, normalOnly);
for(int i = instructions.length-1; i > 0; i--) {
TACInstruction instr = instructions[i];
if(afterResult && instr == targetInstr)
return LabeledSingleResult.createResult(value, normalOnly);
IResult<LE> result = instr.transfer(tf, normalOnly, value);
if(!afterResult && instr == targetInstr)
return result;
value = result.get(normal);
}
TACInstruction instr = instructions[0];
if(afterResult && instr == targetInstr)
return LabeledSingleResult.createResult(value, normalOnly);
else if(!afterResult && (instr == targetInstr || this == targetInstr))
return instr.transfer(tf, labels, value);
else
break;
default:
throw new UnsupportedOperationException("Unknown analysis direction: " + tf.getAnalysisDirection());
}