Sha256: 48ca9450702cbce188568ec10be7b014e306412fd4c8bd2f8b7cf1684c20e7d5

Contents?: true

Size: 325 Bytes

Versions: 3

Compression:

Stored size: 325 Bytes

Contents

require 'mirrors/visitors/iseq_visitor'

module Mirrors
  # DisasmVisitor prints a disassembled version of the bytecodes
  # in a format similar to that used by the disasm() method.
  class DisasmVisitor < Mirrors::ISeqVisitor
    def visit(bytecode)
      puts " #{'%03d' % @pc} #{bytecode}  (#{@line})"
    end
    end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mirrors-0.0.3 lib/mirrors/visitors/disasm_visitor.rb
mirrors-0.0.2 lib/mirrors/visitors/disasm_visitor.rb
mirrors-0.0.1 lib/mirrors/visitors/disasm_visitor.rb