StringBuffer code = new StringBuffer();
// generate code for preemptive transition
code.append(_eol + "/* Preemptive Transition */" + _eol + _eol);
controllerHelper.generateTransitionCode(code,
new TransitionRetriever() {
public Iterator retrieveTransitions(State state) {
return state.preemptiveTransitionList().iterator();
}
});
code.append(_eol);
// check to see if a preemptive transition is taken
code.append("if ("
+ controllerHelper.processCode("$actorSymbol(transitionFlag)")
+ " == 0) {" + _eol);
// generate code for refinements
_generateRefinementCode(code);
// generate code for non-preemptive transition
code.append(_eol + "/* Nonpreemptive Transition */" + _eol + _eol);
controllerHelper.generateTransitionCode(code,
new TransitionRetriever() {
public Iterator retrieveTransitions(State state) {
return state.nonpreemptiveTransitionList().iterator();
}
});