2016-07-03 00:01:04 +03:00
|
|
|
# Used as part of the "make parse" Makefile target.
|
|
|
|
# See common.mk for details.
|
|
|
|
|
2006-12-31 18:02:22 +03:00
|
|
|
$file = ARGV[0]
|
|
|
|
$str = ARGF.read.sub(/^__END__.*\z/m, '')
|
|
|
|
puts '# ' + '-' * 70
|
|
|
|
puts "# target program: "
|
|
|
|
puts '# ' + '-' * 70
|
|
|
|
puts $str
|
|
|
|
puts '# ' + '-' * 70
|
|
|
|
|
2008-07-01 07:05:58 +04:00
|
|
|
$parsed = RubyVM::InstructionSequence.compile_file($file)
|
2006-12-31 18:02:22 +03:00
|
|
|
puts "# disasm result: "
|
|
|
|
puts '# ' + '-' * 70
|
|
|
|
puts $parsed.disasm
|
|
|
|
puts '# ' + '-' * 70
|