move test helper code to support
to be reused
This commit is contained in:
parent
13d8a65e07
commit
1741ad540e
@ -1,2 +1 @@
|
|||||||
require_relative "../helper"
|
require_relative "../helper"
|
||||||
Risc.machine.boot unless Risc.machine.booted
|
|
||||||
|
@ -1,24 +1 @@
|
|||||||
require_relative "../helper"
|
require_relative "../helper"
|
||||||
require "util/eventable"
|
|
||||||
require "risc/interpreter"
|
|
||||||
|
|
||||||
module Risc
|
|
||||||
module Ticker
|
|
||||||
include InterpreterHelpers
|
|
||||||
include CompilerHelper
|
|
||||||
|
|
||||||
def setup
|
|
||||||
Risc.machine.boot
|
|
||||||
do_clean_compile
|
|
||||||
Vool::VoolCompiler.ruby_to_vool( @string_input )
|
|
||||||
Collector.collect_space
|
|
||||||
@interpreter = Interpreter.new
|
|
||||||
@interpreter.start Risc.machine.risc_init
|
|
||||||
end
|
|
||||||
|
|
||||||
# must be after boot, but before main compile, to define method
|
|
||||||
def do_clean_compile
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
@ -1,6 +1,23 @@
|
|||||||
|
require "util/eventable"
|
||||||
|
require "risc/interpreter"
|
||||||
|
require_relative "compiling"
|
||||||
|
|
||||||
module Risc
|
module Risc
|
||||||
# relies on @interpreter instance to be set up during setup
|
module Ticker
|
||||||
module InterpreterHelpers
|
include CompilerHelper
|
||||||
|
|
||||||
|
def setup
|
||||||
|
Risc.machine.boot
|
||||||
|
do_clean_compile
|
||||||
|
Vool::VoolCompiler.ruby_to_vool( @string_input )
|
||||||
|
Collector.collect_space
|
||||||
|
@interpreter = Interpreter.new
|
||||||
|
@interpreter.start Risc.machine.risc_init
|
||||||
|
end
|
||||||
|
|
||||||
|
# must be after boot, but before main compile, to define method
|
||||||
|
def do_clean_compile
|
||||||
|
end
|
||||||
|
|
||||||
# check the given array of instructions is what the interpreter actually does
|
# check the given array of instructions is what the interpreter actually does
|
||||||
# possible second argument ignores the given amount, usually up until main
|
# possible second argument ignores the given amount, usually up until main
|
Loading…
Reference in New Issue
Block a user