fix interpreter test harness and start testing

interpreter on debug for now
This commit is contained in:
Torsten Ruger
2018-03-22 18:54:40 +02:00
parent e505856af7
commit 34903829ca
4 changed files with 11 additions and 10 deletions

View File

@ -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

View File

@ -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