3 import subprocess, sys, shlex
10 args = ['--header-file=' + hfile, '-o', cfile, '-Ppriv_gst_parse_yy', lfile]
11 flex = [r'@FLEX@'] + shlex.split(r'@FLEX_ARGS@')
12 subprocess.check_call(flex + args)
14 prefix = '''#ifdef HAVE_CONFIG_H
18 parse_snippet = '''void priv_gst_parse_yyset_column (int column_no , void * yyscanner);
19 void priv_gst_parse_yyset_column (int column_no , void * yyscanner)
22 contents = open(cfile).read()
23 if not 'priv_gst_parse_yyget_column' in contents:
24 contents = parse_snippet + contents
25 contents = prefix + contents
27 open(cfile, 'w').write(contents)