stash unused
This commit is contained in:
@ -1,36 +0,0 @@
|
||||
module Virtual
|
||||
|
||||
class Constant < ::Virtual::Object
|
||||
end
|
||||
class TrueConstant < Constant
|
||||
end
|
||||
class FalseConstant < Constant
|
||||
end
|
||||
class NilConstant < Constant
|
||||
end
|
||||
|
||||
# another abstract "marker" class (so we can check for it)
|
||||
# derived classes are Boot/Meta Class and StringConstant
|
||||
class ObjectConstant < Constant
|
||||
# def type
|
||||
# Virtual::Reference
|
||||
# end
|
||||
def clazz
|
||||
raise "abstract #{self}"
|
||||
end
|
||||
end
|
||||
|
||||
class IntegerConstant < Constant
|
||||
def initialize int
|
||||
@integer = int
|
||||
end
|
||||
attr_reader :integer
|
||||
def type
|
||||
Virtual::Integer
|
||||
end
|
||||
def fits_u8?
|
||||
integer >= 0 and integer <= 255
|
||||
end
|
||||
end
|
||||
|
||||
end
|
@ -1,38 +0,0 @@
|
||||
module Virtual
|
||||
# So when an object calls a method, or sends a message, this is what it sends: a Message
|
||||
|
||||
# A message contains the sender, return and exceptional return addresses,the arguments,
|
||||
# and a slot for the frame.
|
||||
|
||||
# As such it is a very run-time object, deep in the machinery as it were, and does not have
|
||||
# meaningful methods you could call at compile time.
|
||||
|
||||
# The methods that are there, are nevertheless meant to be called at compile time and generate
|
||||
# code, rather than executing it.
|
||||
|
||||
# The caller creates the Message and passes control to the receiver's method
|
||||
|
||||
# The receiver create a new Frame to hold local and temporary variables and (later) creates
|
||||
# default values for arguments that were not passed
|
||||
|
||||
# How the actual finding of the method takes place (acording to the ruby rules) is not simple,
|
||||
# but as there is a guaranteed result (be it method_missing) it does not matter to the passing
|
||||
# mechanism described
|
||||
|
||||
# During compilation Message and frame objects are created to do type analysis
|
||||
|
||||
class Message
|
||||
|
||||
def initialize me , normal , exceptional
|
||||
@me = me
|
||||
@next_normal = normal
|
||||
@next_exception = exceptional
|
||||
@arguments = arguments
|
||||
# a frame represents the local and temporary variables at a point in the program.
|
||||
@frame = nil
|
||||
end
|
||||
attr_reader :me, :next_normal, :next_exception, :arguments , :frame
|
||||
|
||||
#
|
||||
end
|
||||
end
|
@ -1,4 +1,4 @@
|
||||
require_relative "type"
|
||||
#require_relative "type"
|
||||
|
||||
module Positioned
|
||||
def position
|
||||
|
Reference in New Issue
Block a user