Scheduler scheduler = new SimpleHierarchicalScheduler();  SchedStream schedStream = (SchedStream)toplevel.accept(new SIRSchedBuilder(scheduler));  scheduler.useStream(schedStream);  Schedule schedule = (Schedule)scheduler.computeSchedule();  listToWork = new HashMap();  JMethodDeclaration work = makeWork(schedule.getSchedule(), toplevel);  flatClass.addMethod(work);  toplevel.addMethod(work);  return schedule;
return new SIRScheduler(flatClass).schedule(toplevel);
    public static Schedule schedule(SIRStream toplevel, 				    JClassDeclaration flatClass) {	// make a scheduler	Scheduler scheduler = new SimpleHierarchicalScheduler();	// get a representation of the stream structure	SchedStream schedStream 	    = (SchedStream)toplevel.accept(new SIRSchedBuilder(scheduler));	// set it to compute the schedule of <schedStream>	scheduler.useStream(schedStream);	// compute a schedule	Schedule schedule = (Schedule)scheduler.computeSchedule();	// make new mapping from schedule lists to work functions	listToWork = new HashMap();	// make work function implementing the schedule	JMethodDeclaration work = makeWork(schedule.getSchedule(), 					   toplevel);	// add <work> to <flatClass>	flatClass.addMethod(work);	// add <work> to <toplevel>	toplevel.addMethod(work);	// return schedule for future reference	return schedule;    }