diff --git a/Gemfile b/Gemfile index 08b13919..b79987e6 100644 --- a/Gemfile +++ b/Gemfile @@ -2,6 +2,7 @@ source "http://rubygems.org" gem "parslet" gem "salama-reader" , "0.0.2" , :require => "parser" , :git => "https://github.com/salama/salama-reader.git" +gem "salama-arm" , "0.0.1" , :path => "/Users/raisa/salama-arm" group :development do gem "minitest" diff --git a/Gemfile.lock b/Gemfile.lock index 7606906c..5b17001f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -5,6 +5,12 @@ GIT salama-reader (0.0.2) salama (~> 0.0.1) +PATH + remote: /Users/raisa/salama-arm + specs: + salama-arm (0.0.1) + salama (~> 0.0.1) + GEM remote: http://rubygems.org/ specs: @@ -90,5 +96,6 @@ DEPENDENCIES parslet pry roodi + salama-arm (= 0.0.1)! salama-reader (= 0.0.2)! simplecov diff --git a/lib/register/register_machine.rb b/lib/register/register_machine.rb index af4c7aa4..c56d2e03 100644 --- a/lib/register/register_machine.rb +++ b/lib/register/register_machine.rb @@ -76,6 +76,9 @@ module Register def self.instance + if(@@instance.nil?) + @@instance = Arm::ArmMachine.new + end @@instance end def self.instance= machine @@ -141,3 +144,8 @@ module Register end end end +require_relative "instruction" +require_relative "register_reference" +require_relative "get_implementation" +require_relative "set_implementation" +require "arm/arm_machine" diff --git a/lib/salama.rb b/lib/salama.rb index f957989e..9b770557 100644 --- a/lib/salama.rb +++ b/lib/salama.rb @@ -5,4 +5,5 @@ require 'salama-reader' require 'parser/transform' require "virtual/machine" require "ast/all" -require "sof/all" \ No newline at end of file +require "sof/all" +require "register/register_machine" diff --git a/lib/virtual/machine.rb b/lib/virtual/machine.rb index 84c810c3..1e78831a 100644 --- a/lib/virtual/machine.rb +++ b/lib/virtual/machine.rb @@ -85,5 +85,3 @@ require_relative "object" require_relative "constants" require "boot/boot_space" require_relative "send_implementation" -require_relative "get_implementation" -require_relative "set_implementation"