Debian Codegraph @

storage/innobase/pars/make_bison.sh

raw
1 #!/bin/bash
2 #
3 # Copyright (c) 1994, 2026, Oracle and/or its affiliates.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License, version 2.0,
7 # as published by the Free Software Foundation.
8 #
9 # This program is designed to work with certain software (including
10 # but not limited to OpenSSL) that is licensed under separate terms,
11 # as designated in a particular file or component or in included license
12 # documentation. The authors of MySQL hereby grant you an additional
13 # permission to link the program and your derivative works with the
14 # separately licensed software that they have either included with
15 # the program or referenced in the documentation.
16 #
17 # This program is distributed in the hope that it will be useful,
18 # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 # GNU General Public License, version 2.0, for more details.
21 #
22 # You should have received a copy of the GNU General Public License
23 # along with this program; if not, write to the Free Software
24 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 #
26 # generate parser files from bison input files.
27
28 set -eu
29 TMPFILE=pars0grm.tab.c
30 OUTFILE=pars0grm.cc
31
32 bison -d pars0grm.y
33 mv pars0grm.tab.h ../include/pars0grm.h
34
35 sed -e '
36 s/'"$TMPFILE"'/'"$OUTFILE"'/;
37 s/^\(\(YYSTYPE\|int\) yy\(char\|nerrs\)\)/static \1/;
38 ' < "$TMPFILE" > "$OUTFILE"
39
40 rm "$TMPFILE"