003 File Manager
Current Path:
/usr/src/contrib/byacc/test
usr
/
src
/
contrib
/
byacc
/
test
/
📁
..
📄
README
(142 B)
📁
btyacc
📄
btyacc_calc1.y
(4.42 KB)
📄
btyacc_demo.y
(6.55 KB)
📄
btyacc_destroy1.y
(1.56 KB)
📄
btyacc_destroy2.y
(1.56 KB)
📄
btyacc_destroy3.y
(1.56 KB)
📄
calc.y
(1.84 KB)
📄
calc1.y
(4.22 KB)
📄
calc2.y
(2.31 KB)
📄
calc3.y
(2.37 KB)
📄
calc_code_all.y
(2.07 KB)
📄
calc_code_default.y
(1.92 KB)
📄
calc_code_imports.y
(1.92 KB)
📄
calc_code_provides.y
(1.92 KB)
📄
calc_code_requires.y
(1.92 KB)
📄
calc_code_top.y
(1.91 KB)
📄
code_calc.y
(1.92 KB)
📄
code_debug.y
(341 B)
📄
code_error.y
(341 B)
📄
empty.y
(290 B)
📄
err_inherit1.y
(1.09 KB)
📄
err_inherit2.y
(1.39 KB)
📄
err_inherit3.y
(1.38 KB)
📄
err_inherit4.y
(1.41 KB)
📄
err_inherit5.y
(1.37 KB)
📄
err_syntax1.y
(272 B)
📄
err_syntax10.y
(323 B)
📄
err_syntax11.y
(292 B)
📄
err_syntax12.y
(303 B)
📄
err_syntax13.y
(299 B)
📄
err_syntax14.y
(296 B)
📄
err_syntax15.y
(286 B)
📄
err_syntax16.y
(330 B)
📄
err_syntax17.y
(273 B)
📄
err_syntax18.y
(319 B)
📄
err_syntax19.y
(324 B)
📄
err_syntax2.y
(272 B)
📄
err_syntax20.y
(347 B)
📄
err_syntax21.y
(355 B)
📄
err_syntax22.y
(410 B)
📄
err_syntax23.y
(418 B)
📄
err_syntax24.y
(415 B)
📄
err_syntax25.y
(454 B)
📄
err_syntax26.y
(71 B)
📄
err_syntax27.y
(2.36 KB)
📄
err_syntax3.y
(296 B)
📄
err_syntax4.y
(268 B)
📄
err_syntax5.y
(301 B)
📄
err_syntax6.y
(296 B)
📄
err_syntax7.y
(292 B)
📄
err_syntax7a.y
(293 B)
📄
err_syntax7b.y
(291 B)
📄
err_syntax8.y
(287 B)
📄
err_syntax8a.y
(291 B)
📄
err_syntax9.y
(307 B)
📄
error.y
(269 B)
📄
expr.oxout.y
(29.75 KB)
📄
grammar.y
(26.98 KB)
📄
inherit0.y
(797 B)
📄
inherit1.y
(1.38 KB)
📄
inherit2.y
(1.37 KB)
📄
ok_syntax1.y
(2.92 KB)
📄
pure_calc.y
(2.03 KB)
📄
pure_error.y
(496 B)
📄
quote_calc.y
(1.97 KB)
📄
quote_calc2.y
(1.97 KB)
📄
quote_calc3.y
(2.03 KB)
📄
quote_calc4.y
(2.08 KB)
📄
run_lint.sh
(509 B)
📄
run_make.sh
(3.58 KB)
📄
run_test.sh
(5.9 KB)
📄
varsyntax_calc1.y
(4.48 KB)
📁
yacc
Editing: run_make.sh
#!/bin/sh # $Id: run_make.sh,v 1.18 2019/11/25 23:23:26 tom Exp $ # vi:ts=4 sw=4: # do a test-compile on each of the ".c" files in the test-directory BISON=`bison --version 2>/dev/null | head -n 1 | sed -e 's/^[^0-9.]*//' -e 's/[^0-9.]*$//'` if test $# = 1 then PROG_DIR=`pwd` TEST_DIR=$1 else PROG_DIR=.. TEST_DIR=. fi THIS_DIR=`pwd` ifBTYACC=`fgrep -l 'define YYBTYACC' config.h > /dev/null; test $? != 0; echo $?` if test $ifBTYACC = 0; then REF_DIR=${TEST_DIR}/yacc else REF_DIR=${TEST_DIR}/btyacc fi MY_MAKE="make -f $PROG_DIR/makefile srcdir=$PROG_DIR" run_make() { C_FILE=`basename "$1"` O_FILE=`basename "$C_FILE" .c`.o shift cd $REF_DIR make -f $PROG_DIR/makefile srcdir=$PROG_DIR $O_FILE $* test -f $O_FILE && rm $O_FILE cd $THIS_DIR } echo '** '`date` echo "** program is in $PROG_DIR" echo "** test-files in $REF_DIR" for input in ${REF_DIR}/*.c do case $input in #(vi ${REF_DIR}/err_*|\ ${REF_DIR}/test-err_*) continue ;; esac test -f "$input" || continue run_make "$input" DEFS= case $input in #(vi ${REF_DIR}/pure_*) # DEFS="-DYYLEX_PARAM=flag -DYYLEX_PARAM_TYPE=int" ;; esac if test "x$DEFS" != "x" then run_make "$input" DEFINES="$DEFS" fi done if test -n "$BISON" then echo "** compare with bison $BISON" for input in ${TEST_DIR}/*.y do test -f "$input" || continue case $input in ${TEST_DIR}/err_*|\ ${TEST_DIR}/test-err_*) continue ;; ${TEST_DIR}/ok_syntax*|\ ${TEST_DIR}/varsyntax*) # Bison does not support all byacc legacy syntax continue ;; ${TEST_DIR}/btyacc_*) # Bison does not support the btyacc []-action & inherited attribute extensions. continue ;; esac # Bison does not support pure-parser from command-line. # Also, its support for %expect is generally broken. # Work around these issues using a temporary file. echo "... testing $input" rm -f run_make.[coy] case $input in ${TEST_DIR}/pure_*) if test -z `fgrep -i -l '%pure-parser' $input` then echo "%pure-parser" >>run_make.y fi ;; esac sed -e '/^%expect/s,%expect.*,,' $input >>run_make.y case $BISON in [3-9].[0-9]*.[0-9]*) bison -Wno-other -Wno-conflicts-sr -Wconflicts-rr -y -Wno-yacc run_make.y ;; *) bison -y run_make.y ;; esac if test -f "y.tab.c" then sed -e '/^#line/s,"run_make.y","'$input'",' y.tab.c >run_make.c rm -f y.tab.c input=run_make.c object=run_make.o if test -f $input then $MY_MAKE $object DEFINES='-DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=1 -DYYSTACK_USE_ALLOCA=0 -DYYMAXDEPTH=0' else echo "?? $input not found" fi fi rm -f run_make.[coy] done fi YACC= for name in /usr/ccs/bin/yacc do if test -f $name then YACC=$name fi done if test -n "$YACC" then echo "** compare with $YACC" for input in ${TEST_DIR}/*.y do test -f "$input" || continue echo "... testing $input" rm -f run_make.[coy] case $input in pure_*) echo "... skipping $input" continue; ;; *) if fgrep -i '%pure-parser' $input >/dev/null || fgrep -i '%parse-param' $input >/dev/null || fgrep -i '%lex-param' $input >/dev/null || fgrep -i '%token-table' $input >/dev/null || fgrep 'YYLEX_PARAM' $input >/dev/null then echo "... skipping $input" continue; fi ;; esac sed -e '/^%expect/s,%expect.*,,' $input >>run_make.y $YACC run_make.y if test -f y.tab.c then sed -e '/^#line/s,"run_make.y","'$input'",' y.tab.c >run_make.c rm -f y.tab.c input=run_make.c object=run_make.o if test -f $input then $MY_MAKE $object else echo "?? $input not found" fi fi rm -f run_make.[coy] done fi
Upload File
Create Folder