Example #1
0
 public Object callReporterProcedure(Activation newActivation) {
   boolean oldInReporterProcedure = inReporterProcedure;
   Command command = null;
   inReporterProcedure = true; // so use of "ask" will create an exclusive job
   activation = newActivation;
   ip = 0;
   try {
     do {
       command = activation.procedure().code()[ip];
       if ((agentBit & command.agentBits) == 0) {
         command.throwAgentClassException(this, agent.kind());
       }
       command.perform(this);
       if (command.world.comeUpForAir) {
         comeUpForAir(command);
       }
     } while (!finished && job.result == null);
   } catch (NonLocalExit$ e) {
     // do nothing
   } catch (LogoException ex) {
     EngineException.rethrow(ex, this, command);
   } finally {
     inReporterProcedure = oldInReporterProcedure;
   }
   ip = activation.returnAddress();
   activation = activation.parent();
   Object result = job.result;
   job.result = null;
   return result;
 }
Example #2
0
 public void returnFromProcedure() {
   ip = activation.returnAddress();
   activation = activation.parent();
 }