Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved how bison and flex are used
Replaced bfok.sh with run_bison.sh and run_flex.sh. Simplified these Makefile rules: make jparse.tab.c jparse.tab.h make jparse.c make parser Removed bfok rule. These Makefile variables: ${BISON} ${FLEX} ${BFOK_DIRS} have been replaced with: ${BISON_BASENAME} ${BISON_DIRS} ${FLEX_BASENAME} ${FLEX_DIRS} Here are the usage messages for run_bison.sh and run_flex.sh: run_bison.sh: usage: ./run_bison.sh [-h] [-v level] [-V] [-b bison] [-l limit_ioccc.sh] [-g verge] [-p prefix] [-s sorry.h] [-B dir] .. -- [bison_flags ..] -h print help and exit 8 -v level set debug level (def: 0) -V print version and exit 8 -b bison bison tool basename (def: bison) -l limit_ioccc.sh version info file (def: ./limit_ioccc.sh) -g verge path to verge tool (def: ./verge) -p prefix The prefix of files to be used (def: jparse) NOTE: If the final arg is bison: NOTE: The bison input file will be prefix.y NOTE: If bison cannot be used, then these backup files are used: NOTE: NOTE: prefix.tab.c prefix.tab.h NOTE: -s sorry.h File to prepend to C output (def: sorry.tm.ca.h) -B dir 1st look for bison in dir (def: look just along $PATH) NOTE: Multiple -B dir are allowed. NOTE: Search is performed in dir order before the $PATH path. NOTE: If dir is missing or not searchable, dir is ignored. NOTE: This is ignored if the final arg is NOT bison. -- End of ./run_bison.sh flags bison_flags .. optional flags to give to bison for the prefix.y argument Exit codes: 0 bison output files formed or backup files used instead 2 good bison found and ran but failed to form proper output files 3 bison input file missing or not readable: backup file(s) had to be used 4 backup file(s) are missing, or are not readable 5 failed to use backup file(s) to form the bison C output file(s) 6 limit_ioccc.sh sorry file missing or not readable, or verge missing or not executable 7 BISON_VERSION missing or empty from limit_ioccc.sh 8 -h and help string printed or -V and version string printed 9 Command line usage error >=10 internal error run_flex.sh: usage: ./run_flex.sh [-h] [-v level] [-V] [-f flex] [-l limit_ioccc.sh] [-g verge] [-p prefix] [-s sorry.h] [-F dir] .. -- [flex_flags ..] -h print help and exit 8 -v level set debug level (def: 0) -V print version and exit 8 -f flex flex tool basename (def: flex) -l limit_ioccc.sh version info file (def: ./limit_ioccc.sh) -g verge path to verge tool (def: ./verge) -p prefix The prefix of files to be used (def: jparse) NOTE: If the final arg is flex: NOTE: The flex input file will be prefix.y NOTE: If flex cannot be used, then these backup files are used: NOTE: NOTE: prefix.c NOTE: -s sorry.h File to prepend to C output (def: sorry.tm.ca.h) -F dir 1st look for flex in dir (def: look just along $PATH) NOTE: Multiple -B dir are allowed. NOTE: Search is performed in dir order before the $PATH path. NOTE: If dir is missing or not searchable, dir is ignored. NOTE: This is ignored if the final arg is NOT flex. -- End of ./run_flex.sh flags flex_flags .. optional flags to give to flex for the prefix.y argument Exit codes: 0 flex output files formed or backup files used instead 2 good flex found and ran but failed to form proper output files 3 flex input file missing or not readable: backup file(s) had to be used 4 backup file(s) are missing, or are not readable 5 failed to use backup file(s) to form the flex C output file(s) 6 limit_ioccc.sh sorry file missing or not readable, or verge missing or not executable 7 FLEX_VERSION missing or empty from limit_ioccc.sh 8 -h and help string printed or -V and version string printed 9 Command line usage error >=10 internal error
- Loading branch information