rename Mystery
just unknown, mystery should be more difficult to find out. After all we keep run time info, so just need unknown at compile time
This commit is contained in:
@ -43,7 +43,7 @@ module Virtual
|
||||
method.info = CompiledMethodInfo.new
|
||||
method
|
||||
end
|
||||
def initialize return_type = Virtual::Mystery
|
||||
def initialize return_type = Virtual::Unknown
|
||||
# first block we have to create with .new , as new_block assumes a current
|
||||
enter = Block.new( "enter" , self ).add_code(MethodEnter.new())
|
||||
@return_type = return_type
|
||||
|
@ -11,7 +11,7 @@ module Virtual
|
||||
# Everything in ruby is an expression, ie returns a value. So the effect of every compile
|
||||
# is that a value is put into the ReturnSlot of the current Message.
|
||||
# The compile method (so every compile method) returns the value that it deposits which
|
||||
# may be unknown Mystery value.
|
||||
# may be unknown Unknown value.
|
||||
#
|
||||
# The Compiler.compile uses a visitor patter to dispatch according to the class name of
|
||||
# the expression. So a NameExpression is delegated to compile_name etc.
|
||||
|
@ -68,6 +68,7 @@ module Virtual
|
||||
|
||||
# attr_reader :string
|
||||
def self.compile_string expression , method
|
||||
# Clearly a TODO here to implement strings rather than reusing symbols
|
||||
value = expression.string.to_sym
|
||||
to = Return.new(Reference , value)
|
||||
method.info.constants << value
|
||||
@ -94,7 +95,7 @@ module Virtual
|
||||
|
||||
def self.compile_variable expression, method
|
||||
method.info.add_code InstanceGet.new(expression.name)
|
||||
Return.new( Mystery )
|
||||
Return.new( Unknown )
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -1,26 +1,26 @@
|
||||
module Virtual
|
||||
# The message that is being processed has a layout as per the constant above
|
||||
class MessageSlot < Slot
|
||||
def initialize index , type = Mystery , value = nil
|
||||
def initialize index , type = Unknown , value = nil
|
||||
super(index ,type , value )
|
||||
end
|
||||
end
|
||||
|
||||
class Return < MessageSlot
|
||||
def initialize type = Mystery, value = nil
|
||||
def initialize type = Unknown, value = nil
|
||||
super( MESSAGE_RETURN_VALUE , type , value )
|
||||
end
|
||||
end
|
||||
|
||||
class Self < MessageSlot
|
||||
def initialize type = Mystery, value = nil
|
||||
def initialize type = Unknown, value = nil
|
||||
super( MESSAGE_SELF , type , value )
|
||||
end
|
||||
end
|
||||
|
||||
# Name of the current message
|
||||
class Name < MessageSlot
|
||||
def initialize type = Mystery, value = nil
|
||||
def initialize type = Unknown, value = nil
|
||||
super( MESSAGE_NAME , type , value )
|
||||
end
|
||||
end
|
||||
|
@ -1,24 +1,24 @@
|
||||
module Virtual
|
||||
class NewMessageSlot < Slot
|
||||
def initialize index , type = Mystery, value = nil
|
||||
def initialize index , type = Unknown, value = nil
|
||||
super(index , type , value )
|
||||
end
|
||||
end
|
||||
|
||||
class NewReturn < NewMessageSlot
|
||||
def initialize type = Mystery, value = nil
|
||||
def initialize type = Unknown, value = nil
|
||||
super( MESSAGE_RETURN_VALUE, type , value )
|
||||
end
|
||||
end
|
||||
|
||||
class NewSelf < NewMessageSlot
|
||||
def initialize type = Mystery, value = nil
|
||||
def initialize type = Unknown, value = nil
|
||||
super( MESSAGE_SELF , type , value )
|
||||
end
|
||||
end
|
||||
|
||||
class NewName < NewMessageSlot
|
||||
def initialize type = Mystery, value = nil
|
||||
def initialize type = Unknown, value = nil
|
||||
super( MESSAGE_NAME, type , value )
|
||||
end
|
||||
end
|
||||
|
@ -42,13 +42,13 @@ module Virtual
|
||||
end
|
||||
|
||||
class FrameSlot < Slot
|
||||
def initialize index , type = Mystery, value = nil
|
||||
def initialize index , type = Unknown, value = nil
|
||||
super
|
||||
end
|
||||
end
|
||||
|
||||
class SelfSlot < Slot
|
||||
def initialize index , type = Mystery, value = nil
|
||||
def initialize index , type = Unknown, value = nil
|
||||
super
|
||||
end
|
||||
end
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
module Virtual
|
||||
# Integer and (Object) References are the main derived classes, but float will come and ...
|
||||
# The Mystery Type has unknown type and has only casting methods. So it must be cast to be useful.
|
||||
# The Unknown Type has unknown type and has only casting methods. So it must be cast to be useful.
|
||||
class Type
|
||||
def == other
|
||||
return false unless other.class == self.class
|
||||
@ -20,7 +20,7 @@ module Virtual
|
||||
attr_reader :of_class
|
||||
end
|
||||
|
||||
class Mystery < Type
|
||||
class Unknown < Type
|
||||
end
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user