fix platform derivation and some tests
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
require_relative "translator"
|
||||
module Arm
|
||||
class ArmPlatform
|
||||
class ArmPlatform < Risc::Platform
|
||||
def translator
|
||||
Translator.new
|
||||
end
|
||||
|
@@ -1,6 +1,6 @@
|
||||
|
||||
module Risc
|
||||
class InterpreterPlatform
|
||||
class InterpreterPlatform < Platform
|
||||
def translator
|
||||
IdentityTranslator.new
|
||||
end
|
||||
|
@@ -13,7 +13,13 @@ module Risc
|
||||
include Util::Logging
|
||||
log_level :info
|
||||
|
||||
def initialize
|
||||
def initialize(platform)
|
||||
if(platform.is_a?(Symbol))
|
||||
platform = platform.to_s.capitalize
|
||||
platform = Risc::Platform.for(platform)
|
||||
end
|
||||
raise "Platform must be platform, not #{platform.class}" unless platform.is_a?(Platform)
|
||||
@platform = platform
|
||||
@risc_init = nil
|
||||
@constants = []
|
||||
end
|
||||
|
@@ -27,9 +27,9 @@ module RubyX
|
||||
def ruby_to_binary(platform = :arm)
|
||||
Parfait.boot!
|
||||
Risc.boot!
|
||||
assemblers = ruby_to_mom(platform)
|
||||
assemblers = ruby_to_mom
|
||||
puts "Assemblers #{assemblers}"
|
||||
linker = Linker.new
|
||||
linker = Risc::Linker.new(platform)
|
||||
linker.position_all
|
||||
linker.create_binary
|
||||
end
|
||||
|
Reference in New Issue
Block a user