rubyx/lib/virtual/instructions/virtual_main.rb
Torsten Ruger 53d8f4b163 add source to instruction
for debug
2015-07-18 11:21:49 +03:00

24 lines
517 B
Ruby

module Virtual
# This starts the Virtual machine machine at the given function.
# The implementation is most likely a jump/branch , but since we have the extra layer
# we make good use of it, ie give things descriptive names (what they do, not how)
class VirtualMain < Instruction
include Positioned
def initialize method
@method = method
end
attr_reader :method
def word_length
4
end
def to_s
"#{self.class.name}( method: #{method.name})"
end
end
end