update reader

This commit is contained in:
Torsten Ruger 2014-06-26 11:34:48 +03:00
parent b9ddd75a33
commit 9d0d5aa431
3 changed files with 11 additions and 5 deletions

View File

@ -7,7 +7,7 @@ GIT
GIT
remote: https://github.com/ruby-in-ruby/crystal-reader.git
revision: 0ed11b507f2159a9557f24a5df1333a516ace27f
revision: 7e1c0d7f572256b351655798aadfd160ded07760
specs:
crystal-reader (0.1.0)

View File

@ -42,8 +42,14 @@ module Vm
# storage is a linked list. Has the same api as a ha
@bindings = List.new
end
# run the instruction stream given. Instructions are a graph and executing means traversing it.
# If there is no next instruction the machine stops
def run instruction
instruction.execute
while instruction do
next_instruction = instruction.next
instruction.execute
instruction = next_instruction
end
end
end
end

View File

@ -1,13 +1,13 @@
require_relative '../helper'
require 'parslet/convenience'
module VmHelper
module VirtualHelper
# need a code generator, for arm
def setup
@object_space = Boot::BootSpace.new "Arm"
# @object_space = Boot::BootSpace.new "Arm"
end
def parse
def check
parser = Parser::Crystal.new
syntax = parser.parse_with_debug(@string_input)
parts = Parser::Transform.new.apply(syntax)