provide an interface for initializing an InterpreterProcess without spawning a proces...
authorDavid Crawshaw <david@zentus.com>
Tue, 16 Dec 2008 23:51:43 +0000 (15:51 -0800)
committerDavid Crawshaw <david@zentus.com>
Tue, 16 Dec 2008 23:51:43 +0000 (15:51 -0800)
src/edu/berkeley/fleet/interpreter/Interpreter.java

index b6a68ce..b4492c7 100644 (file)
@@ -132,11 +132,15 @@ public class Interpreter extends FleetTwoFleet implements Parser.FleetWithDynami
     // Run //////////////////////////////////////////////////////////////////////////////
 
     public FleetProcess run(final Instruction[] instructions) {
-        InterpreterProcess ip = new InterpreterProcess(instructions);
+        InterpreterProcess ip = initialize(instructions);
         new Thread(ip).start();
         return ip;
     }
 
+    public InterpreterProcess initialize(Instruction[] instr) {
+        return new InterpreterProcess(instr);
+    }
+
     public class InterpreterProcess extends FleetProcess implements Runnable {
         private Instruction[] instructions;
         public void flush() { }
@@ -182,4 +186,4 @@ public class Interpreter extends FleetTwoFleet implements Parser.FleetWithDynami
         }
 
     }
-}
\ No newline at end of file
+}