rename register to risc
seems to fit the layer much better as we really have a very reduced instruction set
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
module Register
|
||||
module Risc
|
||||
# So when an object calls a method, or sends a message, this is what it sends: a Message
|
||||
|
||||
# A message contains the sender, return and exceptional return addresses,the arguments,
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Register
|
||||
module Risc
|
||||
# Passes, or BlockPasses, could have been procs that just get each block passed.
|
||||
# Instead they are proper objects in case they want to save state.
|
||||
# The idea is
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Register
|
||||
module Risc
|
||||
# Plock (Proc-Block) is mostly a Block but also somewhat Proc-ish: A Block that carries data.
|
||||
#
|
||||
# Data in a Block is usefull in the same way data in objects is. Plocks being otherwise just code.
|
||||
@ -23,18 +23,18 @@ module Register
|
||||
def initialize(name , method , next_block )
|
||||
super
|
||||
@data = []
|
||||
@branch_code = RegisterMachine.instance.b next_block
|
||||
@branch_code = RiscMachine.instance.b next_block
|
||||
end
|
||||
|
||||
def set_next next_b
|
||||
super
|
||||
@branch_code = RegisterMachine.instance.b next_block
|
||||
@branch_code = RiscMachine.instance.b next_block
|
||||
end
|
||||
|
||||
# Data gets assembled after methods
|
||||
def add_data o
|
||||
return if @objects.include? o
|
||||
raise "must be derived from Code #{o.inspect}" unless o.is_a? Register::Code
|
||||
raise "must be derived from Code #{o.inspect}" unless o.is_a? Risc::Code
|
||||
@data << o # TODO check type , no basic values allowed (must be wrapped)
|
||||
end
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Register
|
||||
module Risc
|
||||
# A slot is a slot in an object. It is the storage location for a value.
|
||||
# (Remember, values are typed)
|
||||
# From a memory perspective a slot is an index into an array (the object)
|
||||
|
@ -10,7 +10,7 @@ module Fragments
|
||||
# define setup to NOT load parfait.
|
||||
def setup
|
||||
@stdout = ""
|
||||
@machine = Register.machine.boot
|
||||
@machine = Risc.machine.boot
|
||||
end
|
||||
|
||||
def main()
|
||||
|
@ -1,6 +1,6 @@
|
||||
require_relative 'helper'
|
||||
|
||||
module Register
|
||||
module Risc
|
||||
class TestBasicClass < MiniTest::Test
|
||||
include Fragments
|
||||
|
||||
|
@ -21,7 +21,7 @@ module RuntimeTests
|
||||
end
|
||||
|
||||
def load_program
|
||||
@machine = Register.machine.boot
|
||||
@machine = Risc.machine.boot
|
||||
@machine.parse_and_compile main()
|
||||
@machine.collect
|
||||
end
|
||||
@ -34,7 +34,7 @@ module RuntimeTests
|
||||
|
||||
def check_local ret = nil
|
||||
load_program
|
||||
interpreter = Register::Interpreter.new
|
||||
interpreter = Risc::Interpreter.new
|
||||
interpreter.start @machine.init
|
||||
count = 0
|
||||
begin
|
||||
@ -89,7 +89,7 @@ module RuntimeTests
|
||||
file_name = caller(3).first.split("in ").last.chop.sub("`","")
|
||||
return if file_name.include?("run")
|
||||
file_name = "./tmp/" + file_name + ".o"
|
||||
Register.machine.translate_arm
|
||||
Risc.machine.translate_arm
|
||||
writer = Elf::ObjectWriter.new
|
||||
writer.save file_name
|
||||
file_name
|
||||
|
@ -11,7 +11,7 @@ module ParfaitTests
|
||||
|
||||
def setup
|
||||
@stdout = ""
|
||||
@machine = Register.machine.boot
|
||||
@machine = Risc.machine.boot
|
||||
Vm::Compiler.load_parfait
|
||||
end
|
||||
|
||||
|
@ -20,7 +20,7 @@ class TestRunner < MiniTest::Test
|
||||
def execute file
|
||||
string = File.read(file)
|
||||
parser = Parser::RubyX.new
|
||||
object_space = Register::Program.new "Arm"
|
||||
object_space = Risc::Program.new "Arm"
|
||||
#TODO : files would have to include s-expressions now
|
||||
syntax = parser.parse_with_debug(string, reporter: Parslet::ErrorReporter::Deepest.new)
|
||||
assert syntax
|
||||
@ -32,7 +32,7 @@ class TestRunner < MiniTest::Test
|
||||
expr = part.compile( program.context )
|
||||
else
|
||||
expr = part.compile( program.context )
|
||||
raise "should be function definition for now" unless expr.is_a? Register::Function
|
||||
raise "should be function definition for now" unless expr.is_a? Risc::Function
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user