refactor risc_collection

move code that operates on compiler to the compiler class
this leaves the collection thin, very thin indeed
This commit is contained in:
2019-09-28 15:34:09 +03:00
parent 9f81d78767
commit dcbc3e17be
6 changed files with 106 additions and 117 deletions

View File

@ -30,5 +30,14 @@ module Risc
@block_compilers << compiler
end
# translate this method, which means the method itself and all blocks inside it
# returns the array (of assemblers) that you pass in as collection
def translate_method( translator , collection)
collection << translate_cpu( translator )
@block_compilers.each do |block_compiler|
collection << block_compiler.translate_cpu(translator)
end
collection
end
end
end