From: David Crawshaw Date: Tue, 16 Dec 2008 23:51:43 +0000 (-0800) Subject: provide an interface for initializing an InterpreterProcess without spawning a proces... X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=8605972eb60726b9f9c955524b6bb4718708260a;p=fleet.git provide an interface for initializing an InterpreterProcess without spawning a processing thread --- diff --git a/src/edu/berkeley/fleet/interpreter/Interpreter.java b/src/edu/berkeley/fleet/interpreter/Interpreter.java index b6a68ce..b4492c7 100644 --- a/src/edu/berkeley/fleet/interpreter/Interpreter.java +++ b/src/edu/berkeley/fleet/interpreter/Interpreter.java @@ -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 +}