compile from mom compiler to risc
This commit is contained in:
@ -11,14 +11,14 @@ module Risc
|
||||
#
|
||||
class CallableCompiler
|
||||
|
||||
# Must pass the callable (method/block) and the constants that were parsed
|
||||
# Must pass the callable (method/block)
|
||||
# Also start instuction, usually a label is mandatory
|
||||
def initialize( callable , constants , start)
|
||||
def initialize( callable , mom_label)
|
||||
@callable = callable
|
||||
@regs = []
|
||||
@constants = constants
|
||||
@constants = []
|
||||
@block_compilers = []
|
||||
@current = @risc_instructions = start
|
||||
@current = @risc_instructions = mom_label.risc_label(self)
|
||||
reset_regs
|
||||
end
|
||||
attr_reader :risc_instructions , :constants , :block_compilers , :callable , :current
|
||||
|
@ -5,8 +5,10 @@ module Risc
|
||||
|
||||
class MethodCompiler < CallableCompiler
|
||||
|
||||
def initialize( method )
|
||||
super(method)
|
||||
# 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
|
||||
|
||||
#include block_compilers constants
|
||||
|
Reference in New Issue
Block a user