move interpreter to register

seems more where it belongs, since it interprets the register machine
instructions
This commit is contained in:
Torsten Ruger 2015-11-18 12:00:30 +02:00
parent 40d81681b5
commit 2bc2d4486f
5 changed files with 7 additions and 7 deletions

View File

@ -1,7 +1,7 @@
require_relative "eventable" require_relative "eventable"
module Interpreter module Register
class Interpreter class Interpreter
# fire events for changed pc and register contents # fire events for changed pc and register contents
include Eventable include Eventable

View File

@ -1,5 +1,5 @@
require_relative '../../helper' require_relative '../../helper'
require "interpreter/interpreter" require "register/interpreter"
# Fragments are small programs that we run through the interpreter and really only check # Fragments are small programs that we run through the interpreter and really only check
# - the no. of instructions processed # - the no. of instructions processed
@ -16,7 +16,7 @@ module Fragments
machine = Register.machine.boot machine = Register.machine.boot
machine.parse_and_compile @string_input machine.parse_and_compile @string_input
machine.collect machine.collect
@interpreter = Interpreter::Interpreter.new @interpreter = Register::Interpreter.new
@interpreter.start machine.init @interpreter.start machine.init
count = 0 count = 0
begin begin

View File

@ -1,5 +1,5 @@
require_relative "../helper" require_relative "../helper"
require "interpreter/interpreter" require "register/interpreter"
module Ticker module Ticker
@ -10,7 +10,7 @@ module Ticker
#puts parts.inspect #puts parts.inspect
Soml.compile( parts ) Soml.compile( parts )
machine.collect machine.collect
@interpreter = Interpreter::Interpreter.new @interpreter = Register::Interpreter.new
@interpreter.start Register.machine.init @interpreter.start Register.machine.init
end end

View File

@ -1,5 +1,5 @@
require_relative '../helper' require_relative '../helper'
require "interpreter/interpreter" require "register/interpreter"
require "rye" require "rye"
Rye::Cmd.add_command :ld, '/usr/bin/ld' Rye::Cmd.add_command :ld, '/usr/bin/ld'
Rye::Cmd.add_command :aout, './a.out' Rye::Cmd.add_command :aout, './a.out'
@ -23,7 +23,7 @@ HERE
Soml::Compiler.load_parfait Soml::Compiler.load_parfait
machine.parse_and_compile main.sub("PROGRAM" , @string_input ) machine.parse_and_compile main.sub("PROGRAM" , @string_input )
machine.collect machine.collect
@interpreter = Interpreter::Interpreter.new @interpreter = Register::Interpreter.new
@interpreter.start machine.init @interpreter.start machine.init
count = 0 count = 0
begin begin