2014-06-25 14:20:46 +02:00
|
|
|
require_relative '../helper'
|
|
|
|
require 'parslet/convenience'
|
|
|
|
|
2014-06-26 10:34:48 +02:00
|
|
|
module VirtualHelper
|
2014-06-25 14:20:46 +02:00
|
|
|
# need a code generator, for arm
|
|
|
|
def setup
|
2014-06-26 10:34:48 +02:00
|
|
|
# @object_space = Boot::BootSpace.new "Arm"
|
2014-06-25 14:20:46 +02:00
|
|
|
end
|
|
|
|
|
2014-06-26 10:34:48 +02:00
|
|
|
def check
|
2014-07-17 00:00:15 +02:00
|
|
|
parser = Parser::Sapphire.new
|
2014-06-25 14:20:46 +02:00
|
|
|
syntax = parser.parse_with_debug(@string_input)
|
|
|
|
parts = Parser::Transform.new.apply(syntax)
|
2014-06-26 16:48:33 +02:00
|
|
|
machine = Virtual::Machine.new
|
2014-07-16 18:24:41 +02:00
|
|
|
main = Virtual::MethodDefinition.main
|
2014-07-15 17:27:13 +02:00
|
|
|
expressions = parts.compile(machine.frame , main )
|
2014-06-26 17:39:02 +02:00
|
|
|
assert_equal @output , expressions
|
2014-06-25 14:20:46 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|