zwischenstopp
This commit is contained in:
@ -10,11 +10,17 @@ module Virtual
|
||||
# - next exception instruction
|
||||
# - self (me)
|
||||
# - argument mappings
|
||||
# - local variable mapping
|
||||
# - local variable mapping, together with last called binding
|
||||
class Frame
|
||||
def initialize
|
||||
|
||||
def initialize normal , exceptional , me
|
||||
@next_normal = normal
|
||||
@next_exception = exceptional
|
||||
@me = me
|
||||
# a binding represents the local variables at a point in the program.
|
||||
# The amount of local variables is assumed to be relatively small, and so the
|
||||
# storage is a linked list. Has the same api as a ha
|
||||
@binding = List.new
|
||||
end
|
||||
attr_reader :next_normal, :next_exception, :me, :argument_names
|
||||
attr_reader :next_normal, :next_exception, :me, :binding
|
||||
end
|
||||
end
|
||||
|
@ -37,13 +37,11 @@ module Virtual
|
||||
end
|
||||
|
||||
def initialize
|
||||
# a binding represents the local variables at a point in the program.
|
||||
# The amount of local variables is assumed to be relatively small, and so the
|
||||
# storage is a linked list. Has the same api as a ha
|
||||
@bindings = List.new
|
||||
the_end = HaltInstruction.new
|
||||
@frame = Frame.new(the_end , the_end , :Object)
|
||||
end
|
||||
attr_reader :bindings
|
||||
|
||||
attr_reader :frame
|
||||
|
||||
# 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
|
||||
@ -53,6 +51,10 @@ module Virtual
|
||||
instruction = next_instruction
|
||||
end
|
||||
end
|
||||
#return an anonymous new function (the top level) into which code is compiled
|
||||
def anonymous
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -9,10 +9,12 @@ module Virtual
|
||||
|
||||
end
|
||||
|
||||
class TrueValue < Value
|
||||
class Singleton < Value
|
||||
end
|
||||
class FalseValue < Value
|
||||
class TrueValue < Singleton
|
||||
end
|
||||
class NilValue < Value
|
||||
class FalseValue < Singleton
|
||||
end
|
||||
class NilValue < Singleton
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user