rubyx/lib/risc/method_compiler.rb

25 lines
587 B
Ruby
Raw Normal View History

module Risc
# MethodCompiler is used to generate risc instructions for methods
# and to instantiate the methods correctly.
class MethodCompiler < CallableCompiler
2019-10-03 20:07:55 +02:00
# Methods starts with a Label, both in risc and slot.
# Pass in the callable(method) and the slot label that the method starts with
def initialize( method , slot_label)
super(method , slot_label)
end
2018-06-29 12:03:19 +02:00
def source_name
"#{@callable.self_type.name}.#{@callable.name}"
end
# sometimes the method is used as source (tb reviewed)
def source
@callable
end
end
end