moved all compile to ast, vm does link and assemble. Getting there

This commit is contained in:
Torsten Ruger
2014-05-05 11:03:43 +03:00
parent 99da6f5be3
commit de66238a9e
8 changed files with 58 additions and 127 deletions

View File

@ -19,13 +19,16 @@ class TestRunner < MiniTest::Test
def execute file
string = File.read(file)
syntax = Parser::Composed.new.parse(string)
tree = Parser::Transform.new.apply(syntax)
main = Parser::Transform.new.apply(syntax)
program = Vm::Program.new "Arm"
value = tree.to_value
program.wrap_as_main value
compiled = program.compile( program.context )
program.verify
program.main = main.compile( program.context )
program.link_at( 0 , program.context )
binary = program.assemble(StringIO.new )
puts program.to_yaml
end