}
private boolean compileProcedures() {
workspace.world.program(workspace.world.newProgram());
try {
CompilerResults results =
workspace.compiler().compileProgram
(proceduresInterface.innerSource(), workspace.world.newProgram(getGlobalVariableNames()),
workspace.getExtensionManager());
workspace.setProcedures(results.proceduresMap());
for (Procedure procedure : workspace.getProcedures().values()) {
if (procedure.fileName.equals("")) {
procedure.setOwner(proceduresInterface);
} else if (procedure.fileName.equals("aggregate")) {
procedure.setOwner(workspace.aggregateManager());
} else {
procedure.setOwner(new ExternalFileInterface(procedure.fileName));
}
}
workspace.init();
workspace.world.program(results.program());
new org.nlogo.window.Events.CompiledEvent
(proceduresInterface, results.program(), null, null)
.raise(this);
return true;
} catch (CompilerException error) {
if (AbstractWorkspace.isApplet()) {
System.err.println("CompilerException: " + error);