2009-03-29 07:30:54 +00:00
|
|
|
#!/usr/bin/env ruby
|
|
|
|
# This file is part of Metasm, the Ruby assembly manipulation suite
|
2010-09-09 18:19:35 +00:00
|
|
|
# Copyright (C) 2006-2009 Yoann GUILLOT
|
2009-03-29 07:30:54 +00:00
|
|
|
#
|
|
|
|
# Licence is LGPL, see LICENCE in the top-level directory
|
|
|
|
|
|
|
|
#
|
|
|
|
# this file takes preprocessor files as arguments
|
|
|
|
# it preprocesses their content and dump the result to stdout
|
|
|
|
# it also dumps all macro definitions
|
|
|
|
#
|
|
|
|
|
|
|
|
require 'metasm/preprocessor'
|
|
|
|
|
|
|
|
p = Metasm::Preprocessor.new
|
|
|
|
p.feed(ARGF.read)
|
|
|
|
raw = p.dump
|
|
|
|
puts p.dump_macros(p.definition.keys, false)
|
|
|
|
puts raw
|