Class: Kumi::IR::Printer
- Inherits:
-
Object
- Object
- Kumi::IR::Printer
- Defined in:
- lib/kumi/ir/printer.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(ir_module, io) ⇒ Printer
constructor
A new instance of Printer.
- #print ⇒ Object
Constructor Details
#initialize(ir_module, io) ⇒ Printer
Returns a new instance of Printer.
10 11 12 13 |
# File 'lib/kumi/ir/printer.rb', line 10 def initialize(ir_module, io) @ir_module = ir_module @io = io end |
Class Method Details
.print(ir_module, io: $stdout) ⇒ Object
6 7 8 |
# File 'lib/kumi/ir/printer.rb', line 6 def self.print(ir_module, io: $stdout) new(ir_module, io).print end |
Instance Method Details
#print ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/kumi/ir/printer.rb', line 15 def print ir_module.each_function do |fn| io.puts "function #{fn.name}:" fn.blocks.each do |block| print_block(block) end end end |