fix interpreter test harness and start testing
interpreter on debug for now
This commit is contained in:
parent
e505856af7
commit
34903829ca
@ -65,7 +65,7 @@ module Parfait
|
||||
# private
|
||||
def set_type(type)
|
||||
# puts "Type was set for #{self.class}"
|
||||
raise "not type #{type.class}" unless type.is_a?(Type)
|
||||
raise "not type #{type.class} in #{self}" unless type.is_a?(Type)
|
||||
@type = type
|
||||
end
|
||||
|
||||
|
@ -17,7 +17,7 @@ module Risc
|
||||
# fire events for changed pc and register contents
|
||||
include Eventable
|
||||
include Logging
|
||||
log_level :info
|
||||
log_level :debug
|
||||
|
||||
attr_reader :instruction # current instruction or pc
|
||||
attr_reader :clock # current instruction or pc
|
||||
|
@ -9,7 +9,7 @@ module Risc
|
||||
def setup
|
||||
Risc.machine.boot
|
||||
do_clean_compile
|
||||
#FIXME Vm.compile_ast( @input )
|
||||
Vool::VoolCompiler.ruby_to_vool( @string_input )
|
||||
Collector.collect_space
|
||||
@interpreter = Interpreter.new
|
||||
@interpreter.start Risc.machine.init
|
||||
|
@ -7,22 +7,23 @@ module Risc
|
||||
def setup
|
||||
@string_input = <<HERE
|
||||
class Space
|
||||
int main()
|
||||
return 5 + 7
|
||||
def main(arg)
|
||||
return 5.mod4
|
||||
end
|
||||
end
|
||||
HERE
|
||||
@input = s(:statements, s(:return, s(:operator_value, :+, s(:int, 5), s(:int, 7))))
|
||||
super
|
||||
end
|
||||
|
||||
def pest_chain
|
||||
def test_chain
|
||||
#show_ticks # get output of what is
|
||||
check_chain [Branch, Label, LoadConstant, SlotToReg, RegToSlot,
|
||||
LoadConstant, RegToSlot, FunctionCall, Label, LoadConstant,
|
||||
LoadConstant, OperatorInstruction, RegToSlot, LoadConstant, SlotToReg,
|
||||
RegToSlot, Label, FunctionReturn, Transfer, Syscall,
|
||||
NilClass]
|
||||
SlotToReg, RegToSlot, LoadConstant, SlotToReg, SlotToReg,
|
||||
SlotToReg, RegToSlot, LoadConstant, SlotToReg, SlotToReg,
|
||||
SlotToReg, RegToSlot, LoadConstant, SlotToReg, RegToSlot,
|
||||
LoadConstant, SlotToReg, RegToSlot, SlotToReg, LoadConstant,
|
||||
FunctionCall, Label, Label, NilClass]
|
||||
end
|
||||
|
||||
def pest_get
|
||||
|
Loading…
Reference in New Issue
Block a user