change build names a little and document

This commit is contained in:
Torsten Ruger
2018-04-07 22:35:40 +03:00
parent 6d1beec407
commit 26cf911a5c
6 changed files with 59 additions and 21 deletions

View File

@ -79,7 +79,7 @@ module Risc
instruction = instruction.next
end
end
# add a risc instruction after the current (insertion point)
# the added instruction will become the new insertion point
def add_code( instruction )
@ -170,5 +170,15 @@ module Risc
def reduce_int( source , register )
add_slot_to_reg( source + "int -> fix" , register , Parfait::Integer.integer_index , register)
end
# Build with builder (see there), adding the created instructions
def build(&block)
builder.build_and_return(&block)
end
# return a new builder that uses this compiler
def builder
Builder.new(self)
end
end
end