mirror of
https://github.com/MariaDB/server.git
synced 2025-01-21 06:22:28 +01:00
fe5e0b7245
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.
18 lines
369 B
Bash
Executable file
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"
|