diff options
Diffstat (limited to 'test/YACC/YACC-fixture/myyacc.py')
-rw-r--r-- | test/YACC/YACC-fixture/myyacc.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/YACC/YACC-fixture/myyacc.py b/test/YACC/YACC-fixture/myyacc.py new file mode 100644 index 0000000..c2e1abf --- /dev/null +++ b/test/YACC/YACC-fixture/myyacc.py @@ -0,0 +1,13 @@ +import getopt +import sys +cmd_opts, args = getopt.getopt(sys.argv[1:], 'o:', []) +output = None +opt_string = '' +for opt, arg in cmd_opts: + if opt == '-o': output = open(arg, 'wb') + else: opt_string = opt_string + ' ' + opt +for a in args: + contents = open(a, 'rb').read() + output.write(contents.replace(b'YACC', b'myyacc.py')) +output.close() +sys.exit(0) |