rubyx/lib/risc/method_compiler.rb

25 lines
583 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-08-10 11:42:47 +02:00
# Methods starts with a Label, both in risc and mom.
# Pass in the callable(method) and the mom label that the method starts with
def initialize( method , mom_label)
super(method , mom_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