mariadb/pars/make_bison.sh
marko fe5e0b7245 branches/zip: Make the changes to pars0grm.c that were promised in r2276.
pars/pars0grm.h: Remove.  The primary file is include/pars0grm.h.

pars/make_bison.sh: Add from trunk.  Somehow, this file was not merged
at the same time with make_flex.sh.  Add sed magic for replacing the
file name and for hiding yychars, yynerrs, yylval, and yyparse.

pars/pars0grm.c: Apply the changes made by make_bison.sh.
2008-02-06 16:01:57 +00:00

18 lines
369 B
Bash
Executable file

#!/bin/bash
#
# generate parser files from bison input files.
set -eu
TMPFILE=pars0grm.tab.c
OUTFILE=pars0grm.c
bison -d pars0grm.y
mv pars0grm.tab.h ../include/pars0grm.h
sed -e '
s/'"$TMPFILE"'/'"$OUTFILE"'/;
s/^\(\(YYSTYPE\|int\) yy\(char\|nerrs\)\)/static \1/;
s/\(\(YYSTYPE\|int\) yy\(lval\|parse\)\)/UNIV_INTERN \1/;
' < "$TMPFILE" > "$OUTFILE"
rm "$TMPFILE"