summaryrefslogtreecommitdiff
path: root/test/YACC/YACC-fixture/myyacc.py
blob: c2e1abf13743591c7d30bdc5545be0548ce602bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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)