summaryrefslogtreecommitdiffstats
path: root/tools/extract_bnf.sh.in
diff options
context:
space:
mode:
authorTomek Mrugalski <tomek@isc.org>2021-06-23 12:40:48 +0200
committerTomek Mrugalski <tomek@isc.org>2021-06-23 12:40:48 +0200
commitd810d7344dedc960794c01f8126ff7b87e14db5f (patch)
tree5e949831963837e5c5f6f665d41d93d3e7c1401a /tools/extract_bnf.sh.in
parent[#745] Grammar header reworded (diff)
downloadkea-d810d7344dedc960794c01f8126ff7b87e14db5f.tar.xz
kea-d810d7344dedc960794c01f8126ff7b87e14db5f.zip
[#745] extract_bnf now always use English
Diffstat (limited to 'tools/extract_bnf.sh.in')
-rwxr-xr-xtools/extract_bnf.sh.in12
1 files changed, 7 insertions, 5 deletions
diff --git a/tools/extract_bnf.sh.in b/tools/extract_bnf.sh.in
index 1030f76ff3..bbf74b371c 100755
--- a/tools/extract_bnf.sh.in
+++ b/tools/extract_bnf.sh.in
@@ -17,7 +17,7 @@
# ./extract_bnf.sh <bison-file-base-name> --markdown
# Check if there are one or two arguments
-if [ $# -le 1 ]; then
+if [ $# -lt 1 ]; then
echo "extract_bnf.sh <bison-file-base-name> [--markdown <name>]"
exit 1
fi
@@ -35,10 +35,12 @@ now=$(date +"%Y-%m-%-d %H:%m")
header="Grammar generated on $now. See Chapter $md_name for an explanation."
-if [ -f "${base}.output" ]; then
- output="${base}.output"
-elif [ -f "${base}.yy" ]; then
- /usr/bin/bison -v "${base}.yy" -o output
+if [ -f "${base}.yy" ]; then
+ # We want to explicitly set the language to English. Otherwise
+ # bison may produce language specific wording (like "symbole terminalne"
+ # if you system is set to Polish, rather than "Terminals") and this will
+ # confuse our script.
+ LANG=en_US LANGUAGE=en_US @YACC@ -v "${base}.yy" -o output
rm -f output output.h *.hh
mv output.output /tmp/output
output=/tmp/output