rubyx/lib/virtual/slots/next_message_slot.rb

51 lines
1.2 KiB
Ruby
Raw Normal View History

2015-06-20 23:21:42 +02:00
module Virtual
# The next Message is one of four objects the virtual machine knows
#
2015-06-29 19:55:45 +02:00
# Slots represent instance variables of objects, so NewMessageSlots
# represent instance variables of NewMessage objects.
2015-06-20 23:21:42 +02:00
# The Message has a layout as per the constant above
2015-06-29 19:55:45 +02:00
class NewMessageSlot < Slot
def initialize type = Unknown, value = nil
super( type , value )
2015-06-20 23:21:42 +02:00
end
def object_name
:new_message
end
2015-06-20 23:21:42 +02:00
end
# named classes exist for slots that often accessed
2015-06-29 19:55:45 +02:00
# NewReturn is the return of NewMessageSlot
class NewReturn < NewMessageSlot
2015-06-20 23:21:42 +02:00
def initialize type = Unknown, value = nil
super( type , value )
2015-06-20 23:21:42 +02:00
end
end
2015-06-29 19:55:45 +02:00
# NewSelf is the self of NewMessageSlot
class NewSelf < NewMessageSlot
2015-06-20 23:21:42 +02:00
def initialize type = Unknown, value = nil
super( type , value )
2015-06-20 23:21:42 +02:00
end
end
2015-06-29 19:55:45 +02:00
# NewMessageName of the next message
class NewMessageName < NewMessageSlot
2015-06-20 23:21:42 +02:00
def initialize type = Unknown, value = nil
super( type , value )
2015-06-20 23:21:42 +02:00
end
end
2015-06-29 19:55:45 +02:00
# NewMessageName of the next message
class NewArgSlot < NewMessageSlot
def initialize index , type = Unknown, value = nil
@index = index
super( type , value )
end
attr_reader :index
end
2015-06-20 23:21:42 +02:00
end