rubyx/lib/virtual/slots/message_slot.rb

52 lines
1.2 KiB
Ruby
Raw Normal View History

2015-05-06 07:38:29 +02:00
module Virtual
2015-06-20 22:49:30 +02:00
# The current Message is one of four objects the virtual machine knows
#
# Slots represent instance variables of objects, so MessageSlots
# represent instance variables of Message objects.
# The Message has a layout as per the constant above
2015-05-06 07:38:29 +02:00
class MessageSlot < Slot
def initialize type = Unknown , value = nil
super(type , value )
2015-05-06 07:38:29 +02:00
end
def object_name
:message
end
2015-05-06 07:38:29 +02:00
end
2015-06-20 23:21:42 +02:00
# named classes exist for slots that often accessed
# Return is the return of MessageSlot
2015-05-06 07:38:29 +02:00
class Return < MessageSlot
def initialize type = Unknown, value = nil
super( type , value )
2015-05-06 07:38:29 +02:00
end
end
# Self is the self in MessageSlot
2015-05-06 07:38:29 +02:00
class Self < MessageSlot
def initialize type = Unknown, value = nil
super( type , value )
2015-05-06 07:38:29 +02:00
end
end
# MessageName of the current message
class MessageName < MessageSlot
def initialize type = Unknown, value = nil
super( type , value )
2015-05-06 07:38:29 +02:00
end
end
# NewMessageName of the next message
class ArgSlot < MessageSlot
def initialize index , type = Unknown, value = nil
@index = index
super( type , value )
end
attr_reader :index
end
2015-05-06 07:38:29 +02:00
end