3 # This script runs Bison and/or Flex to regenerate the files as follows:
4 # parser.y -> parser.cpp, parser.h
5 # scanner.l -> scanner.cpp, scanner_flex.h
6 # The commands are run only if the generated files are older than the
7 # Bison/Flex input files, or if a '-f' flag is provided.
10 if [ "x$1" == "x-f" ] ; then
14 if [ "x$BISON" == "x" ] ; then
17 if [ "x$FLEX" == "x" ] ; then
21 # For convenience, change to the directory where the files are located
22 # if the script is run from the root of the source tree.
23 dirname=src/gromacs/selection
24 if [[ -f $dirname/parser.y && -f $dirname/scanner.l ]] ; then
28 [[ $FORCE || parser.y -nt parser.cpp ]] && $BISON -t -o parser.cpp --defines=parser.h parser.y
29 [[ $FORCE || scanner.l -nt scanner.cpp ]] && $FLEX -o scanner.cpp scanner.l