reflow-oven-control-sw/tprcc/bison-wrapper.sh

31 lines
476 B
Bash
Raw Normal View History

#!/bin/bash
set -e
# Usage: bison-wrapper.sh <c-file> <include-file> <location.hh> <bison_file> <bison-parameters>
if [[ $# -lt 4 ]]; then
echo "Error. Not enough parameters"
exit -1
fi
cfile=$1
shift
include=$1
shift
location=$1
shift
tmpdir=`mktemp -d`
cd $tmpdir
echo "Using $tmpdir"
echo cp *.tab.cpp "$cfile"
echo cp *.hpp "$include"
echo cp location.hh "$location"
bison $@
cp *.tab.cpp "$cfile"
cp *.hpp "$include"
cp location.hh "$location"
rm -rfv "$tmpdir"