diff --git a/lib/crystal.rb b/lib/crystal.rb index 56fb20eb..83653551 100644 --- a/lib/crystal.rb +++ b/lib/crystal.rb @@ -4,12 +4,4 @@ require "elf/object_writer" require 'parser/crystal' require 'parser/transform' require "ast/all" -require "vm/register_machine" -require "vm/code" -require "vm/values" -require "vm/block" -require "vm/function" -require "boot/boot_class" -require "boot/boot_space" -require "stream_reader" -require "kernel/all" +require "vm/object_machine" diff --git a/lib/vm/constants.rb b/lib/virtual/constants.rb similarity index 100% rename from lib/vm/constants.rb rename to lib/virtual/constants.rb diff --git a/lib/vm/instruction.rb b/lib/virtual/instruction.rb similarity index 100% rename from lib/vm/instruction.rb rename to lib/virtual/instruction.rb diff --git a/lib/vm/integer.rb b/lib/virtual/integer.rb similarity index 100% rename from lib/vm/integer.rb rename to lib/virtual/integer.rb diff --git a/lib/vm/mystery.rb b/lib/virtual/mystery.rb similarity index 100% rename from lib/vm/mystery.rb rename to lib/virtual/mystery.rb diff --git a/lib/vm/object_machine.rb b/lib/virtual/object_machine.rb similarity index 100% rename from lib/vm/object_machine.rb rename to lib/virtual/object_machine.rb diff --git a/lib/vm/reference.rb b/lib/virtual/reference.rb similarity index 100% rename from lib/vm/reference.rb rename to lib/virtual/reference.rb diff --git a/lib/vm/word.rb b/lib/virtual/word.rb similarity index 100% rename from lib/vm/word.rb rename to lib/virtual/word.rb diff --git a/test/virtual/helper.rb b/test/virtual/helper.rb new file mode 100644 index 00000000..8ef44bd5 --- /dev/null +++ b/test/virtual/helper.rb @@ -0,0 +1,21 @@ +require_relative '../helper' +require 'parslet/convenience' + +module VmHelper + # need a code generator, for arm + def setup + @object_space = Boot::BootSpace.new "Arm" + end + + def parse + parser = Parser::Crystal.new + syntax = parser.parse_with_debug(@string_input) + parts = Parser::Transform.new.apply(syntax) + + parts.each_with_index do |part,index| + expr = part.compile( @object_space.context ) + end + + end + +end