• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/env python3
2
3import subprocess, sys, shlex
4
5cfile = sys.argv[1]
6hfile = sys.argv[2]
7yfile = sys.argv[3]
8
9args = ['-d', '-v', '-ppriv_gst_parse_yy', yfile, '-o', cfile]
10bison = [r'@BISON@'] + shlex.split(r'@BISON_ARGS@')
11subprocess.check_call(bison + args)
12
13prefix = '''
14#ifdef HAVE_CONFIG_H
15#include<config.h>
16#endif
17'''
18
19contents = open(cfile).read()
20content = prefix + contents
21open(cfile, 'w').write(contents)
22