2008-12-01 07:10:29 +01:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
2013-12-16 15:38:05 +01:00
|
|
|
# Copyright (c) 1994, 2011, Oracle and/or its affiliates. All Rights Reserved.
|
|
|
|
#
|
2009-03-26 07:11:11 +01:00
|
|
|
# This program is free software; you can redistribute it and/or modify it under
|
|
|
|
# the terms of the GNU General Public License as published by the Free Software
|
|
|
|
# Foundation; version 2 of the License.
|
2013-12-16 15:38:05 +01:00
|
|
|
#
|
2009-03-26 07:11:11 +01:00
|
|
|
# This program is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
|
|
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
2013-12-16 15:38:05 +01:00
|
|
|
#
|
2009-03-26 07:11:11 +01:00
|
|
|
# You should have received a copy of the GNU General Public License along with
|
2013-12-16 15:38:05 +01:00
|
|
|
# this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
|
2009-03-26 07:11:11 +01:00
|
|
|
#
|
2008-12-01 07:10:29 +01:00
|
|
|
# generate parser files from bison input files.
|
|
|
|
|
|
|
|
set -eu
|
|
|
|
TMPFILE=pars0grm.tab.c
|
2013-12-16 15:38:05 +01:00
|
|
|
OUTFILE=pars0grm.cc
|
2008-12-01 07:10:29 +01:00
|
|
|
|
|
|
|
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"
|