Torsten Rüger
1e5073200c
both in mom and risc method complers alll just compilers now, all linked Required to move some code down into callable_compiler but all in all quite little. cleaner
25 lines
583 B
Ruby
25 lines
583 B
Ruby
module Risc
|
|
|
|
# MethodCompiler is used to generate risc instructions for methods
|
|
# and to instantiate the methods correctly.
|
|
|
|
class MethodCompiler < CallableCompiler
|
|
|
|
# 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
|
|
|
|
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
|