diff options
author | jmmv <jmmv@FreeBSD.org> | 2014-04-14 13:30:08 +0000 |
---|---|---|
committer | jmmv <jmmv@FreeBSD.org> | 2014-04-14 13:30:08 +0000 |
commit | d9b0a628da4b486dde00400305ad3a2ecefa0205 (patch) | |
tree | 70bd9eedb0e9eac2ac2cd3dcfc26f48adfd1ae7a /tools/regression/usr.bin | |
parent | bd8afe2477108733f19a3171f80f6c8d9daef3bf (diff) | |
download | FreeBSD-src-d9b0a628da4b486dde00400305ad3a2ecefa0205.zip FreeBSD-src-d9b0a628da4b486dde00400305ad3a2ecefa0205.tar.gz |
MFC various fixes to the tools/regression/ tests.
- r262953 Fix m4 tests so that they run cleanly with prove.
- r262954 Fix printf tests so that they run cleanly with prove.
- r262959 Fix sed tests so that they run cleanly with prove.
- r262960 Fix yacc tests so that they run cleanly with prove.
- r262961 Fix pkill tests so that they run cleanly with prove.
- r262962 Fix ncal tests so that they run cleanly with prove.
- r263081 Fix lastcomm tests under amd64.
- r263082 Only run the make tests when make is fmake.
- r263083 Fix sa tests.
- r263084 Turn a test precondition into a skip in the mdconfig tests.
- r263085 Make the strerror tests work without libtap.
- r263087 Remove broken tests for eui64_line.
- r263221 Change etcupdate tests to return 1 on test failures.
- r263352 Make the priv test program exit with non-zero if any failures are detected.
- r263353 errx prepends the program name to the message; don't do it by hand.
- r263362 Include strings.h so that bpf_filter.c can be built in userland.
Diffstat (limited to 'tools/regression/usr.bin')
27 files changed, 296 insertions, 330 deletions
diff --git a/tools/regression/usr.bin/lastcomm/regress.t b/tools/regression/usr.bin/lastcomm/regress.t index 6abca0b..d733dbc 100755 --- a/tools/regression/usr.bin/lastcomm/regress.t +++ b/tools/regression/usr.bin/lastcomm/regress.t @@ -6,6 +6,8 @@ DIR=`dirname $0` ARCH=`uname -m` +TZ=UTC; export TZ + check() { NUM=$1 diff --git a/tools/regression/usr.bin/lastcomm/v1-amd64.out b/tools/regression/usr.bin/lastcomm/v1-amd64.out index c0a379f..bacbd57 100644 --- a/tools/regression/usr.bin/lastcomm/v1-amd64.out +++ b/tools/regression/usr.bin/lastcomm/v1-amd64.out @@ -1,28 +1,28 @@ -core -FDX root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 06:44 -core -DX root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 06:44 -cc - root 0.000 secs 0.000 us 0.000 sy 0.016 es Wed May 16 06:44 -ld - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 06:44 -as - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 06:44 -cc1 - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 06:44 -time - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 06:44 -time -F root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 06:44 -ln - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 06:44 -time - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 06:44 -time -F root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 06:44 -ln - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 06:44 -time - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 06:44 -time -F root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 06:44 -ln - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 06:44 -time - root 0.000 secs 0.000 us 0.000 sy 0.234 es Wed May 16 06:44 -diff - root 0.203 secs 0.203 us 0.000 sy 0.234 es Wed May 16 06:44 -time - root 0.000 secs 0.000 us 0.000 sy 0.016 es Wed May 16 06:44 -dd - root 0.016 secs 0.000 us 0.016 sy 0.016 es Wed May 16 06:44 -time - root 0.000 secs 0.000 us 0.000 sy 3.016 es Wed May 16 06:44 -sleep - root 0.000 secs 0.000 us 0.000 sy 3.000 es Wed May 16 06:44 -time - root 0.000 secs 0.000 us 0.000 sy 1.938 es Wed May 16 06:44 -find - root 0.250 secs 0.031 us 0.219 sy 1.938 es Wed May 16 06:44 -time - root 0.000 secs 0.000 us 0.000 sy 3.062 es Wed May 16 06:44 -egrep - root 3.031 secs 3.031 us 0.000 sy 3.062 es Wed May 16 06:44 -time - root 0.000 secs 0.000 us 0.000 sy 0.188 es Wed May 16 06:44 -awk - root 0.172 secs 0.172 us 0.000 sy 0.188 es Wed May 16 06:44 -accton - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 06:44 +core -FDX root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 11:44 +core -DX root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 11:44 +cc - root 0.000 secs 0.000 us 0.000 sy 0.016 es Wed May 16 11:44 +ld - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 11:44 +as - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 11:44 +cc1 - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 11:44 +time - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 11:44 +time -F root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 11:44 +ln - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 11:44 +time - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 11:44 +time -F root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 11:44 +ln - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 11:44 +time - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 11:44 +time -F root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 11:44 +ln - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 11:44 +time - root 0.000 secs 0.000 us 0.000 sy 0.234 es Wed May 16 11:44 +diff - root 0.203 secs 0.203 us 0.000 sy 0.234 es Wed May 16 11:44 +time - root 0.000 secs 0.000 us 0.000 sy 0.016 es Wed May 16 11:44 +dd - root 0.016 secs 0.000 us 0.016 sy 0.016 es Wed May 16 11:44 +time - root 0.000 secs 0.000 us 0.000 sy 3.016 es Wed May 16 11:44 +sleep - root 0.000 secs 0.000 us 0.000 sy 3.000 es Wed May 16 11:44 +time - root 0.000 secs 0.000 us 0.000 sy 1.938 es Wed May 16 11:44 +find - root 0.250 secs 0.031 us 0.219 sy 1.938 es Wed May 16 11:44 +time - root 0.000 secs 0.000 us 0.000 sy 3.062 es Wed May 16 11:44 +egrep - root 3.031 secs 3.031 us 0.000 sy 3.062 es Wed May 16 11:44 +time - root 0.000 secs 0.000 us 0.000 sy 0.188 es Wed May 16 11:44 +awk - root 0.172 secs 0.172 us 0.000 sy 0.188 es Wed May 16 11:44 +accton - root 0.000 secs 0.000 us 0.000 sy 0.000 es Wed May 16 11:44 diff --git a/tools/regression/usr.bin/lastcomm/v2-amd64.out b/tools/regression/usr.bin/lastcomm/v2-amd64.out index 5795e63..3942b04 100644 --- a/tools/regression/usr.bin/lastcomm/v2-amd64.out +++ b/tools/regression/usr.bin/lastcomm/v2-amd64.out @@ -1,28 +1,28 @@ -core -FDX root 0.002 secs 0.000 us 0.002 sy 0.009 es Thu May 17 00:57 -core -DX root 0.005 secs 0.000 us 0.005 sy 0.010 es Thu May 17 00:57 -cc - root 0.005 secs 0.000 us 0.005 sy 0.652 es Thu May 17 00:57 -ld - root 0.014 secs 0.005 us 0.009 sy 0.150 es Thu May 17 00:57 -as - root 0.005 secs 0.000 us 0.005 sy 0.078 es Thu May 17 00:57 -cc1 - root 0.024 secs 0.008 us 0.016 sy 0.347 es Thu May 17 00:57 -time - root 0.003 secs 0.000 us 0.003 sy 0.005 es Thu May 17 00:57 -1234567890123456 - root 0.002 secs 0.000 us 0.002 sy 0.002 es Thu May 17 00:57 -ln - root 0.002 secs 0.000 us 0.002 sy 0.002 es Thu May 17 00:57 -time - root 0.003 secs 0.000 us 0.003 sy 0.005 es Thu May 17 00:57 -1234567890123456 - root 0.002 secs 0.000 us 0.002 sy 0.002 es Thu May 17 00:57 -ln - root 0.002 secs 0.000 us 0.002 sy 0.002 es Thu May 17 00:57 -time - root 0.003 secs 0.000 us 0.003 sy 0.013 es Thu May 17 00:57 -123456789012345 - root 0.002 secs 0.000 us 0.002 sy 0.010 es Thu May 17 00:57 -ln - root 0.003 secs 0.000 us 0.003 sy 0.003 es Thu May 17 00:57 -time - root 0.003 secs 0.000 us 0.003 sy 0.246 es Thu May 17 00:57 -diff - root 0.223 secs 0.164 us 0.060 sy 0.243 es Thu May 17 00:57 -time - root 0.003 secs 0.000 us 0.003 sy 0.079 es Thu May 17 00:57 -dd - root 0.076 secs 0.000 us 0.076 sy 0.076 es Thu May 17 00:57 -time - root 0.004 secs 0.000 us 0.004 sy 3.006 es Thu May 17 00:57 -sleep - root 0.002 secs 0.000 us 0.002 sy 3.002 es Thu May 17 00:57 -time - root 0.003 secs 0.000 us 0.003 sy 9.945 es Thu May 17 00:57 -find - root 0.822 secs 0.055 us 0.767 sy 9.942 es Thu May 17 00:57 -time - root 0.003 secs 0.000 us 0.003 sy 3.313 es Thu May 17 00:57 -egrep - root 3.247 secs 3.247 us 0.000 sy 3.310 es Thu May 17 00:57 -time - root 0.003 secs 0.000 us 0.003 sy 0.185 es Thu May 17 00:57 -awk - root 0.163 secs 0.156 us 0.007 sy 0.164 es Thu May 17 00:57 -accton - root 0.002 secs 0.000 us 0.002 sy 0.019 es Thu May 17 00:57 +core -FDX root 0.002 secs 0.000 us 0.002 sy 0.009 es Thu May 17 05:57 +core -DX root 0.005 secs 0.000 us 0.005 sy 0.010 es Thu May 17 05:57 +cc - root 0.005 secs 0.000 us 0.005 sy 0.652 es Thu May 17 05:57 +ld - root 0.014 secs 0.005 us 0.009 sy 0.150 es Thu May 17 05:57 +as - root 0.005 secs 0.000 us 0.005 sy 0.078 es Thu May 17 05:57 +cc1 - root 0.024 secs 0.008 us 0.016 sy 0.347 es Thu May 17 05:57 +time - root 0.003 secs 0.000 us 0.003 sy 0.005 es Thu May 17 05:57 +1234567890123456 - root 0.002 secs 0.000 us 0.002 sy 0.002 es Thu May 17 05:57 +ln - root 0.002 secs 0.000 us 0.002 sy 0.002 es Thu May 17 05:57 +time - root 0.003 secs 0.000 us 0.003 sy 0.005 es Thu May 17 05:57 +1234567890123456 - root 0.002 secs 0.000 us 0.002 sy 0.002 es Thu May 17 05:57 +ln - root 0.002 secs 0.000 us 0.002 sy 0.002 es Thu May 17 05:57 +time - root 0.003 secs 0.000 us 0.003 sy 0.013 es Thu May 17 05:57 +123456789012345 - root 0.002 secs 0.000 us 0.002 sy 0.010 es Thu May 17 05:57 +ln - root 0.003 secs 0.000 us 0.003 sy 0.003 es Thu May 17 05:57 +time - root 0.003 secs 0.000 us 0.003 sy 0.246 es Thu May 17 05:57 +diff - root 0.223 secs 0.164 us 0.060 sy 0.243 es Thu May 17 05:57 +time - root 0.003 secs 0.000 us 0.003 sy 0.079 es Thu May 17 05:57 +dd - root 0.076 secs 0.000 us 0.076 sy 0.076 es Thu May 17 05:57 +time - root 0.004 secs 0.000 us 0.004 sy 3.006 es Thu May 17 05:57 +sleep - root 0.002 secs 0.000 us 0.002 sy 3.002 es Thu May 17 05:57 +time - root 0.003 secs 0.000 us 0.003 sy 9.945 es Thu May 17 05:57 +find - root 0.822 secs 0.055 us 0.767 sy 9.942 es Thu May 17 05:57 +time - root 0.003 secs 0.000 us 0.003 sy 3.313 es Thu May 17 05:57 +egrep - root 3.247 secs 3.247 us 0.000 sy 3.310 es Thu May 17 05:57 +time - root 0.003 secs 0.000 us 0.003 sy 0.185 es Thu May 17 05:57 +awk - root 0.163 secs 0.156 us 0.007 sy 0.164 es Thu May 17 05:57 +accton - root 0.002 secs 0.000 us 0.002 sy 0.019 es Thu May 17 05:57 diff --git a/tools/regression/usr.bin/m4/regress.gnusofterror.out b/tools/regression/usr.bin/m4/regress.gnusofterror.out index 8baef1b..322fa4c 100644 --- a/tools/regression/usr.bin/m4/regress.gnusofterror.out +++ b/tools/regression/usr.bin/m4/regress.gnusofterror.out @@ -1 +1,2 @@ +m4: gnusofterror.m4 at line 3: include(hey I do not exit): No such file or directory abc diff --git a/tools/regression/usr.bin/m4/regress.sh b/tools/regression/usr.bin/m4/regress.sh index 198cfa2..6f22f7d 100644 --- a/tools/regression/usr.bin/m4/regress.sh +++ b/tools/regression/usr.bin/m4/regress.sh @@ -2,7 +2,7 @@ LC_ALL=C; export LC_ALL -echo 1..22 +echo 1..21 REGRESSION_START($1) @@ -17,7 +17,7 @@ REGRESSION_TEST(`gnuformat', `m4 -g gnuformat.m4') REGRESSION_TEST(`gnupatterns', `m4 -g gnupatterns.m4') REGRESSION_TEST(`gnupatterns2', `m4 -g gnupatterns2.m4') REGRESSION_TEST(`gnuprefix', `m4 -P gnuprefix.m4 2>&1') -REGRESSION_TEST(`gnusofterror', `m4 -g gnusofterror.m4') +REGRESSION_TEST(`gnusofterror', `m4 -g gnusofterror.m4 2>&1') REGRESSION_TEST(`gnutranslit2', `m4 -g translit2.m4') REGRESSION_TEST(`includes', `m4 -I. includes.m4') REGRESSION_TEST(`m4wrap3', `m4 m4wrap3.m4') diff --git a/tools/regression/usr.bin/m4/regress.t b/tools/regression/usr.bin/m4/regress.t index c36d834..a82aacd 100644 --- a/tools/regression/usr.bin/m4/regress.t +++ b/tools/regression/usr.bin/m4/regress.t @@ -3,4 +3,4 @@ cd `dirname $0` -sh regress.sh +m4 ../regress.m4 regress.sh | sh diff --git a/tools/regression/usr.bin/make/common.sh b/tools/regression/usr.bin/make/common.sh index f38467f..cc7622e 100644 --- a/tools/regression/usr.bin/make/common.sh +++ b/tools/regression/usr.bin/make/common.sh @@ -13,6 +13,13 @@ fatal() exit 1 } +make_is_fmake() { + # This test is not very reliable but works for now: the old fmake + # does have a -v option while bmake doesn't. + ${MAKE_PROG} -f Makefile.non-existent -v 2>&1 | \ + grep -q "cannot open.*non-existent" +} + # # Check whether the working directory exists - it must. # @@ -322,19 +329,25 @@ eval_compare() while [ ${N} -le ${TEST_N} ] ; do fail= todo= + skip= if ! skip_test ${N} ; then do_compare stdout ${N} || fail="${fail}stdout " do_compare stderr ${N} || fail="${fail}stderr " do_compare status ${N} || fail="${fail}status " eval todo=\${TEST_${N}_TODO} + else + eval skip=\${TEST_${N}_SKIP} fi if [ ! -z "$fail" ]; then echo -n "not " fi echo -n "ok ${N} ${SUBDIR}/${N}" - if [ ! -z "$fail" -o ! -z "$todo" ]; then + if [ ! -z "$fail" -o ! -z "$todo" -o ! -z "$skip" ]; then echo -n " # " fi + if [ ! -z "$skip" ] ; then + echo -n "skip $skip; " + fi if [ ! -z "$todo" ] ; then echo -n "TODO $todo; " fi @@ -473,6 +486,12 @@ eval_cmd() set -- prove fi + if ! make_is_fmake ; then + for i in $(jot ${TEST_N:-1}) ; do + eval TEST_${i}_SKIP=\"make is not fmake\" + done + fi + for i do case $i in diff --git a/tools/regression/usr.bin/ncal/regress.sh b/tools/regression/usr.bin/ncal/regress.sh index 3dc188d..709744f 100644 --- a/tools/regression/usr.bin/ncal/regress.sh +++ b/tools/regression/usr.bin/ncal/regress.sh @@ -6,6 +6,8 @@ NCAL="${CAL_BIN} -N" YEARS="2008 2009 2010 2011" ONEYEAR="2009" +echo 1..89 + REGRESSION_START($1) # @@ -15,8 +17,6 @@ REGRESSION_START($1) # Full year calendars -echo 1..16 - for y in ${YEARS}; do # Regular calendar, Month days, No-highlight REGRESSION_TEST(`r-y${y}-md-nhl', `$NCAL -h ${y}') @@ -30,8 +30,6 @@ done # 3 month calendars -echo 17 .. 29 - for m in $(jot -w %02d 12); do # Regular calendar, Month days, No-highlight REGRESSION_TEST(`r-3m${ONEYEAR}${m}-md-nhl', diff --git a/tools/regression/usr.bin/pkill/pgrep-_s.t b/tools/regression/usr.bin/pkill/pgrep-_s.t index 5ce98e6..ce0bde3 100644 --- a/tools/regression/usr.bin/pkill/pgrep-_s.t +++ b/tools/regression/usr.bin/pkill/pgrep-_s.t @@ -5,15 +5,17 @@ base=`basename $0` echo "1..2" +exp_pid="$(ps ax | grep '\[idle\]' | awk '{print $1}')" + name="pgrep -S" -pid=`pgrep -Sx g_event` -if [ "$pid" = "2" ]; then +pid=`pgrep -Sx idle` +if [ "$pid" = "$exp_pid" ]; then echo "ok 1 - $name" else echo "not ok 1 - $name" fi -pid=`pgrep -x g_event` -if [ "$pid" != "2" ]; then +pid=`pgrep -x idle` +if [ "$pid" != "$exp_pid" ]; then echo "ok 2 - $name" else echo "not ok 2 - $name" diff --git a/tools/regression/usr.bin/printf/regress.sh b/tools/regression/usr.bin/printf/regress.sh index 3f7f9aa..84e183b 100644 --- a/tools/regression/usr.bin/printf/regress.sh +++ b/tools/regression/usr.bin/printf/regress.sh @@ -2,7 +2,7 @@ REGRESSION_START($1) -echo '1..12' +echo '1..15' REGRESSION_TEST(`b', `printf "abc%b%b" "def\n" "\cghi"') REGRESSION_TEST(`d', `printf "%d,%5d,%.5d,%0*d,%.*d\n" 123 123 123 5 123 5 123') diff --git a/tools/regression/usr.bin/sed/regress.sh b/tools/regression/usr.bin/sed/regress.sh index 37dc037..c4c2a33 100644 --- a/tools/regression/usr.bin/sed/regress.sh +++ b/tools/regression/usr.bin/sed/regress.sh @@ -2,7 +2,7 @@ REGRESSION_START($1) -echo '1..25' +echo '1..26' REGRESSION_TEST(`G', `sed G < regress.in') REGRESSION_TEST(`P', `sed P < regress.in') diff --git a/tools/regression/usr.bin/yacc/regress.00.out b/tools/regression/usr.bin/yacc/regress.00.out index f785627..39a8ca2 100644 --- a/tools/regression/usr.bin/yacc/regress.00.out +++ b/tools/regression/usr.bin/yacc/regress.00.out @@ -5,6 +5,7 @@ static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; #define YYBYACC 1 #define YYMAJOR 1 #define YYMINOR 9 +#define YYPATCH 20140101 #define YYEMPTY (-1) #define yyclearin (yychar = YYEMPTY) @@ -77,10 +78,11 @@ static const short yycheck[] = { -1, #define YYDEBUG 0 #endif #define YYMAXTOKEN 0 +#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a)) #if YYDEBUG static const char *yyname[] = { -"end-of-file", +"end-of-file","illegal-symbol", }; static const char *yyrule[] = { "$accept : rule", @@ -105,12 +107,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; @@ -145,7 +147,7 @@ static int yygrowstack(YYSTACKDATA *data) else if ((newsize *= 2) > YYMAXDEPTH) newsize = YYMAXDEPTH; - i = data->s_mark - data->s_base; + i = (int) (data->s_mark - data->s_base); newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); if (newss == 0) return -1; @@ -219,9 +221,7 @@ yyloop: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -303,9 +303,7 @@ yyinrecovery: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, error recovery discards token %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -348,9 +346,7 @@ yyreduce: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, YYFINAL, yychar, yys); } diff --git a/tools/regression/usr.bin/yacc/regress.01.out b/tools/regression/usr.bin/yacc/regress.01.out index cc4845e..8187502 100644 --- a/tools/regression/usr.bin/yacc/regress.01.out +++ b/tools/regression/usr.bin/yacc/regress.01.out @@ -5,6 +5,7 @@ static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; #define YYBYACC 1 #define YYMAJOR 1 #define YYMINOR 9 +#define YYPATCH 20140101 #define YYEMPTY (-1) #define yyclearin (yychar = YYEMPTY) @@ -25,7 +26,7 @@ int base; extern int yylex(void); static void yyerror(const char *s); -#line 28 "/dev/stdout" +#line 29 "/dev/stdout" #ifndef YYSTYPE typedef int YYSTYPE; @@ -152,6 +153,7 @@ static const short yycheck[] = { 40, #define YYDEBUG 0 #endif #define YYMAXTOKEN 259 +#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a)) #if YYDEBUG static const char *yyname[] = { @@ -162,7 +164,7 @@ static const char *yyname[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,"DIGIT","LETTER","UMINUS", +0,0,0,0,0,0,"DIGIT","LETTER","UMINUS","illegal-symbol", }; static const char *yyrule[] = { "$accept : list", @@ -204,12 +206,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; @@ -263,7 +265,7 @@ yylex(void) } return( c ); } -#line 266 "/dev/stdout" +#line 267 "/dev/stdout" #if YYDEBUG #include <stdio.h> /* needed for printf */ @@ -287,7 +289,7 @@ static int yygrowstack(YYSTACKDATA *data) else if ((newsize *= 2) > YYMAXDEPTH) newsize = YYMAXDEPTH; - i = data->s_mark - data->s_base; + i = (int) (data->s_mark - data->s_base); newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); if (newss == 0) return -1; @@ -361,9 +363,7 @@ yyloop: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -445,9 +445,7 @@ yyinrecovery: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, error recovery discards token %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -529,7 +527,7 @@ case 18: #line 63 "calc.y" { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 532 "/dev/stdout" +#line 529 "/dev/stdout" } yystack.s_mark -= yym; yystate = *yystack.s_mark; @@ -551,9 +549,7 @@ break; #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, YYFINAL, yychar, yys); } diff --git a/tools/regression/usr.bin/yacc/regress.02.out b/tools/regression/usr.bin/yacc/regress.02.out index c0e7a75..30de536 100644 --- a/tools/regression/usr.bin/yacc/regress.02.out +++ b/tools/regression/usr.bin/yacc/regress.02.out @@ -5,6 +5,7 @@ static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; #define YYBYACC 1 #define YYMAJOR 1 #define YYMINOR 9 +#define YYPATCH 20140101 #define YYEMPTY (-1) #define yyclearin (yychar = YYEMPTY) @@ -55,7 +56,7 @@ typedef union INTERVAL vval; } YYSTYPE; #endif /* !YYSTYPE_IS_DECLARED */ -#line 58 "/dev/stdout" +#line 59 "/dev/stdout" /* compatibility with bison */ #ifdef YYPARSE_PARAM @@ -192,6 +193,7 @@ static const short yycheck[] = { 40, #define YYDEBUG 0 #endif #define YYMAXTOKEN 260 +#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a)) #if YYDEBUG static const char *yyname[] = { @@ -202,7 +204,7 @@ static const char *yyname[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,"DREG","VREG","CONST","UMINUS", +0,0,"DREG","VREG","CONST","UMINUS","illegal-symbol", }; static const char *yyrule[] = { "$accept : line", @@ -254,12 +256,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; @@ -402,7 +404,7 @@ vdiv(double a, double b, INTERVAL v) { return (hilo(a / v.hi, a / v.lo, b / v.hi, b / v.lo)); } -#line 405 "/dev/stdout" +#line 406 "/dev/stdout" #if YYDEBUG #include <stdio.h> /* needed for printf */ @@ -426,7 +428,7 @@ static int yygrowstack(YYSTACKDATA *data) else if ((newsize *= 2) > YYMAXDEPTH) newsize = YYMAXDEPTH; - i = data->s_mark - data->s_base; + i = (int) (data->s_mark - data->s_base); newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); if (newss == 0) return -1; @@ -500,9 +502,7 @@ yyloop: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -584,9 +584,7 @@ yyinrecovery: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, error recovery discards token %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -771,7 +769,7 @@ case 28: yyval.vval = yystack.l_mark[-1].vval; } break; -#line 774 "/dev/stdout" +#line 771 "/dev/stdout" } yystack.s_mark -= yym; yystate = *yystack.s_mark; @@ -793,9 +791,7 @@ break; #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, YYFINAL, yychar, yys); } diff --git a/tools/regression/usr.bin/yacc/regress.03.out b/tools/regression/usr.bin/yacc/regress.03.out index 55ed6ae..a8c9f8c 100644 --- a/tools/regression/usr.bin/yacc/regress.03.out +++ b/tools/regression/usr.bin/yacc/regress.03.out @@ -5,6 +5,7 @@ static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; #define YYBYACC 1 #define YYMAJOR 1 #define YYMINOR 9 +#define YYPATCH 20140101 #define YYEMPTY (-1) #define yyclearin (yychar = YYEMPTY) @@ -28,7 +29,7 @@ int YYLEX_DECL(); static void YYERROR_DECL(); #endif -#line 31 "/dev/stdout" +#line 32 "/dev/stdout" #ifndef YYSTYPE typedef int YYSTYPE; @@ -159,6 +160,7 @@ static const short yycheck[] = { 40, #define YYDEBUG 0 #endif #define YYMAXTOKEN 259 +#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a)) #if YYDEBUG static const char *yyname[] = { @@ -169,7 +171,7 @@ static const char *yyname[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,"DIGIT","LETTER","UMINUS", +0,0,0,0,0,0,"DIGIT","LETTER","UMINUS","illegal-symbol", }; static const char *yyrule[] = { "$accept : list", @@ -206,12 +208,12 @@ int yynerrs; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; @@ -270,7 +272,7 @@ YYLEX_DECL() } return( c ); } -#line 273 "/dev/stdout" +#line 274 "/dev/stdout" #if YYDEBUG #include <stdio.h> /* needed for printf */ @@ -294,7 +296,7 @@ static int yygrowstack(YYSTACKDATA *data) else if ((newsize *= 2) > YYMAXDEPTH) newsize = YYMAXDEPTH; - i = data->s_mark - data->s_base; + i = (int) (data->s_mark - data->s_base); newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); if (newss == 0) return -1; @@ -375,9 +377,7 @@ yyloop: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -459,9 +459,7 @@ yyinrecovery: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, error recovery discards token %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -543,7 +541,7 @@ case 18: #line 73 "calc3.y" { yyval = (*base) * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 546 "/dev/stdout" +#line 543 "/dev/stdout" } yystack.s_mark -= yym; yystate = *yystack.s_mark; @@ -565,9 +563,7 @@ break; #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, YYFINAL, yychar, yys); } diff --git a/tools/regression/usr.bin/yacc/regress.04.out b/tools/regression/usr.bin/yacc/regress.04.out index d9a2006..cd93e86 100644 --- a/tools/regression/usr.bin/yacc/regress.04.out +++ b/tools/regression/usr.bin/yacc/regress.04.out @@ -5,6 +5,7 @@ static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; #define YYBYACC 1 #define YYMAJOR 1 #define YYMINOR 9 +#define YYPATCH 20140101 #define YYEMPTY (-1) #define yyclearin (yychar = YYEMPTY) @@ -27,7 +28,7 @@ int yylex(void); static void yyerror(const char *s); #endif -#line 30 "/dev/stdout" +#line 31 "/dev/stdout" #ifndef YYSTYPE typedef int YYSTYPE; @@ -154,6 +155,7 @@ static const short yycheck[] = { 40, #define YYDEBUG 0 #endif #define YYMAXTOKEN 259 +#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a)) #if YYDEBUG static const char *yyname[] = { @@ -164,7 +166,7 @@ static const char *yyname[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,"DIGIT","LETTER","UMINUS", +0,0,0,0,0,0,"DIGIT","LETTER","UMINUS","illegal-symbol", }; static const char *yyrule[] = { "$accept : list", @@ -206,12 +208,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; @@ -269,7 +271,7 @@ yylex(void) } return( c ); } -#line 272 "/dev/stdout" +#line 273 "/dev/stdout" #if YYDEBUG #include <stdio.h> /* needed for printf */ @@ -293,7 +295,7 @@ static int yygrowstack(YYSTACKDATA *data) else if ((newsize *= 2) > YYMAXDEPTH) newsize = YYMAXDEPTH; - i = data->s_mark - data->s_base; + i = (int) (data->s_mark - data->s_base); newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); if (newss == 0) return -1; @@ -367,9 +369,7 @@ yyloop: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -451,9 +451,7 @@ yyinrecovery: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, error recovery discards token %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -535,7 +533,7 @@ case 18: #line 65 "code_calc.y" { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 538 "/dev/stdout" +#line 535 "/dev/stdout" } yystack.s_mark -= yym; yystate = *yystack.s_mark; @@ -557,9 +555,7 @@ break; #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, YYFINAL, yychar, yys); } diff --git a/tools/regression/usr.bin/yacc/regress.05.out b/tools/regression/usr.bin/yacc/regress.05.out index 3f643db..2fbf0d9 100644 --- a/tools/regression/usr.bin/yacc/regress.05.out +++ b/tools/regression/usr.bin/yacc/regress.05.out @@ -5,6 +5,7 @@ static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; #define YYBYACC 1 #define YYMAJOR 1 #define YYMINOR 9 +#define YYPATCH 20140101 #define YYEMPTY (-1) #define yyclearin (yychar = YYEMPTY) @@ -22,7 +23,7 @@ int yylex(void); static void yyerror(const char *); #endif -#line 25 "/dev/stdout" +#line 26 "/dev/stdout" #ifndef YYSTYPE typedef int YYSTYPE; @@ -89,10 +90,11 @@ static const short yycheck[] = { 256, #define YYDEBUG 0 #endif #define YYMAXTOKEN 0 +#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a)) #if YYDEBUG static const char *yyname[] = { -"end-of-file", +"end-of-file","illegal-symbol", }; static const char *yyrule[] = { "$accept : S", @@ -117,12 +119,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; @@ -160,7 +162,7 @@ yyerror(const char* s) { printf("%s\n", s); } -#line 163 "/dev/stdout" +#line 164 "/dev/stdout" #if YYDEBUG #include <stdio.h> /* needed for printf */ @@ -184,7 +186,7 @@ static int yygrowstack(YYSTACKDATA *data) else if ((newsize *= 2) > YYMAXDEPTH) newsize = YYMAXDEPTH; - i = data->s_mark - data->s_base; + i = (int) (data->s_mark - data->s_base); newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); if (newss == 0) return -1; @@ -258,9 +260,7 @@ yyloop: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -342,9 +342,7 @@ yyinrecovery: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, error recovery discards token %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -387,9 +385,7 @@ yyreduce: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, YYFINAL, yychar, yys); } diff --git a/tools/regression/usr.bin/yacc/regress.06.out b/tools/regression/usr.bin/yacc/regress.06.out index 1dc80eb..d2305e1 100644 --- a/tools/regression/usr.bin/yacc/regress.06.out +++ b/tools/regression/usr.bin/yacc/regress.06.out @@ -5,6 +5,7 @@ static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; #define YYBYACC 1 #define YYMAJOR 1 #define YYMINOR 9 +#define YYPATCH 20140101 #define YYEMPTY (-1) #define yyclearin (yychar = YYEMPTY) @@ -18,7 +19,7 @@ static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; #line 2 "error.y" int yylex(void); static void yyerror(const char *); -#line 21 "/dev/stdout" +#line 22 "/dev/stdout" #ifndef YYSTYPE typedef int YYSTYPE; @@ -85,10 +86,11 @@ static const short yycheck[] = { 256, #define YYDEBUG 0 #endif #define YYMAXTOKEN 0 +#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a)) #if YYDEBUG static const char *yyname[] = { -"end-of-file", +"end-of-file","illegal-symbol", }; static const char *yyrule[] = { "$accept : S", @@ -113,12 +115,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; @@ -152,7 +154,7 @@ yyerror(const char* s) { printf("%s\n", s); } -#line 155 "/dev/stdout" +#line 156 "/dev/stdout" #if YYDEBUG #include <stdio.h> /* needed for printf */ @@ -176,7 +178,7 @@ static int yygrowstack(YYSTACKDATA *data) else if ((newsize *= 2) > YYMAXDEPTH) newsize = YYMAXDEPTH; - i = data->s_mark - data->s_base; + i = (int) (data->s_mark - data->s_base); newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); if (newss == 0) return -1; @@ -250,9 +252,7 @@ yyloop: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -334,9 +334,7 @@ yyinrecovery: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, error recovery discards token %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -379,9 +377,7 @@ yyreduce: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, YYFINAL, yychar, yys); } diff --git a/tools/regression/usr.bin/yacc/regress.07.out b/tools/regression/usr.bin/yacc/regress.07.out index de06e38..ae185a0 100644 --- a/tools/regression/usr.bin/yacc/regress.07.out +++ b/tools/regression/usr.bin/yacc/regress.07.out @@ -5,6 +5,7 @@ static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; #define YYBYACC 1 #define YYMAJOR 1 #define YYMINOR 9 +#define YYPATCH 20140101 #define YYEMPTY (-1) #define yyclearin (yychar = YYEMPTY) @@ -114,7 +115,7 @@ yyerror(const char *msg) { perror(msg); } -#line 117 "/dev/stdout" +#line 118 "/dev/stdout" #ifndef YYSTYPE typedef int YYSTYPE; @@ -357,6 +358,7 @@ static const short yycheck[] = { 89, #define YYDEBUG 0 #endif #define YYMAXTOKEN 319 +#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a)) #if YYDEBUG static const char *yyname[] = { @@ -372,6 +374,7 @@ static const char *yyname[] = { "MAIL","MSND","MSOM","MSAM","MRSQ","MRCP","ALLO","REST","RNFR","RNTO","ABOR", "DELE","CWD","LIST","NLST","SITE","STAT","HELP","NOOP","MKD","RMD","PWD","CDUP", "STOU","SMNT","SYST","SIZE","MDTM","UMASK","IDLE","CHMOD","LEXERR", +"illegal-symbol", }; static const char *yyrule[] = { "$accept : cmd_list", @@ -468,12 +471,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; @@ -1008,7 +1011,7 @@ sizecmd(char *filename) reply(504, "SIZE not implemented for Type %c.", "?AEIL"[type]); } } -#line 1011 "/dev/stdout" +#line 1013 "/dev/stdout" #if YYDEBUG #include <stdio.h> /* needed for printf */ @@ -1032,7 +1035,7 @@ static int yygrowstack(YYSTACKDATA *data) else if ((newsize *= 2) > YYMAXDEPTH) newsize = YYMAXDEPTH; - i = data->s_mark - data->s_base; + i = (int) (data->s_mark - data->s_base); newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); if (newss == 0) return -1; @@ -1106,9 +1109,7 @@ yyloop: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -1190,9 +1191,7 @@ yyinrecovery: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, error recovery discards token %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -1851,7 +1850,7 @@ case 73: } } break; -#line 1854 "/dev/stdout" +#line 1852 "/dev/stdout" } yystack.s_mark -= yym; yystate = *yystack.s_mark; @@ -1873,9 +1872,7 @@ break; #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, YYFINAL, yychar, yys); } diff --git a/tools/regression/usr.bin/yacc/regress.08.out b/tools/regression/usr.bin/yacc/regress.08.out index c86f19f..d5d3ae0 100644 --- a/tools/regression/usr.bin/yacc/regress.08.out +++ b/tools/regression/usr.bin/yacc/regress.08.out @@ -5,6 +5,7 @@ static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; #define YYBYACC 1 #define YYMAJOR 1 #define YYMINOR 9 +#define YYPATCH 20140101 #define YYEMPTY (-1) #define yyclearin (yychar = YYEMPTY) @@ -302,7 +303,7 @@ haveAnsiParam (void) } return FALSE; } -#line 305 "/dev/stdout" +#line 306 "/dev/stdout" /* compatibility with bison */ #ifdef YYPARSE_PARAM @@ -660,6 +661,7 @@ static const short yycheck[] = { 38, #define YYDEBUG 0 #endif #define YYMAXTOKEN 291 +#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a)) #if YYDEBUG static const char *yyname[] = { @@ -676,6 +678,7 @@ static const char *yyname[] = { "T_UNSIGNED","T_ENUM","T_STRUCT","T_UNION","T_Bool","T_Complex","T_Imaginary", "T_TYPE_QUALIFIER","T_BRACKETS","T_LBRACE","T_MATCHRBRACE","T_ELLIPSIS", "T_INITIALIZER","T_STRING_LITERAL","T_ASM","T_ASMARG","T_VA_DCL", +"illegal-symbol", }; static const char *yyrule[] = { "$accept : program", @@ -813,12 +816,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; @@ -1001,7 +1004,7 @@ free_parser(void) #endif } #endif -#line 1004 "/dev/stdout" +#line 1006 "/dev/stdout" #if YYDEBUG #include <stdio.h> /* needed for printf */ @@ -1025,7 +1028,7 @@ static int yygrowstack(YYSTACKDATA *data) else if ((newsize *= 2) > YYMAXDEPTH) newsize = YYMAXDEPTH; - i = data->s_mark - data->s_base; + i = (int) (data->s_mark - data->s_base); newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); if (newss == 0) return -1; @@ -1099,9 +1102,7 @@ yyloop: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -1183,9 +1184,7 @@ yyinrecovery: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, error recovery discards token %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -1881,7 +1880,7 @@ case 114: yyval.declarator->func_def = FUNC_ANSI; } break; -#line 1884 "/dev/stdout" +#line 1882 "/dev/stdout" } yystack.s_mark -= yym; yystate = *yystack.s_mark; @@ -1903,9 +1902,7 @@ break; #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, YYFINAL, yychar, yys); } diff --git a/tools/regression/usr.bin/yacc/regress.09.out b/tools/regression/usr.bin/yacc/regress.09.out index 5eaf258..b6c13e2 100644 --- a/tools/regression/usr.bin/yacc/regress.09.out +++ b/tools/regression/usr.bin/yacc/regress.09.out @@ -5,6 +5,7 @@ static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; #define YYBYACC 1 #define YYMAJOR 1 #define YYMINOR 9 +#define YYPATCH 20140101 #define YYEMPTY (-1) #define yyclearin (yychar = YYEMPTY) @@ -31,7 +32,7 @@ int YYLEX_DECL(); static void YYERROR_DECL(); #endif -#line 34 "/dev/stdout" +#line 35 "/dev/stdout" #ifndef YYSTYPE typedef int YYSTYPE; @@ -158,6 +159,7 @@ static const short yycheck[] = { 40, #define YYDEBUG 0 #endif #define YYMAXTOKEN 259 +#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a)) #if YYDEBUG static const char *yyname[] = { @@ -168,7 +170,7 @@ static const char *yyname[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,"DIGIT","LETTER","UMINUS", +0,0,0,0,0,0,"DIGIT","LETTER","UMINUS","illegal-symbol", }; static const char *yyrule[] = { "$accept : list", @@ -210,12 +212,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; @@ -273,7 +275,7 @@ YYLEX_DECL() } return( c ); } -#line 276 "/dev/stdout" +#line 277 "/dev/stdout" #if YYDEBUG #include <stdio.h> /* needed for printf */ @@ -297,7 +299,7 @@ static int yygrowstack(YYSTACKDATA *data) else if ((newsize *= 2) > YYMAXDEPTH) newsize = YYMAXDEPTH; - i = data->s_mark - data->s_base; + i = (int) (data->s_mark - data->s_base); newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); if (newss == 0) return -1; @@ -371,9 +373,7 @@ yyloop: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -455,9 +455,7 @@ yyinrecovery: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, error recovery discards token %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -539,7 +537,7 @@ case 18: #line 69 "pure_calc.y" { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 542 "/dev/stdout" +#line 539 "/dev/stdout" } yystack.s_mark -= yym; yystate = *yystack.s_mark; @@ -561,9 +559,7 @@ break; #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, YYFINAL, yychar, yys); } diff --git a/tools/regression/usr.bin/yacc/regress.10.out b/tools/regression/usr.bin/yacc/regress.10.out index 02cba4f..f4a5ba4 100644 --- a/tools/regression/usr.bin/yacc/regress.10.out +++ b/tools/regression/usr.bin/yacc/regress.10.out @@ -5,6 +5,7 @@ static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; #define YYBYACC 1 #define YYMAJOR 1 #define YYMINOR 9 +#define YYPATCH 20140101 #define YYEMPTY (-1) #define yyclearin (yychar = YYEMPTY) @@ -26,7 +27,7 @@ int YYLEX_DECL(); static void YYERROR_DECL(); #endif -#line 29 "/dev/stdout" +#line 30 "/dev/stdout" #ifndef YYSTYPE typedef int YYSTYPE; @@ -93,10 +94,11 @@ static const short yycheck[] = { 256, #define YYDEBUG 0 #endif #define YYMAXTOKEN 0 +#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a)) #if YYDEBUG static const char *yyname[] = { -"end-of-file", +"end-of-file","illegal-symbol", }; static const char *yyrule[] = { "$accept : S", @@ -121,12 +123,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; @@ -164,7 +166,7 @@ yyerror(const char* s) { printf("%s\n", s); } -#line 167 "/dev/stdout" +#line 168 "/dev/stdout" #if YYDEBUG #include <stdio.h> /* needed for printf */ @@ -188,7 +190,7 @@ static int yygrowstack(YYSTACKDATA *data) else if ((newsize *= 2) > YYMAXDEPTH) newsize = YYMAXDEPTH; - i = data->s_mark - data->s_base; + i = (int) (data->s_mark - data->s_base); newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); if (newss == 0) return -1; @@ -262,9 +264,7 @@ yyloop: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -346,9 +346,7 @@ yyinrecovery: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, error recovery discards token %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -391,9 +389,7 @@ yyreduce: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, YYFINAL, yychar, yys); } diff --git a/tools/regression/usr.bin/yacc/regress.11.out b/tools/regression/usr.bin/yacc/regress.11.out index 1d6561d..8668971 100644 --- a/tools/regression/usr.bin/yacc/regress.11.out +++ b/tools/regression/usr.bin/yacc/regress.11.out @@ -5,6 +5,7 @@ static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; #define YYBYACC 1 #define YYMAJOR 1 #define YYMINOR 9 +#define YYPATCH 20140101 #define YYEMPTY (-1) #define yyclearin (yychar = YYEMPTY) @@ -25,7 +26,7 @@ int base; int yylex(void); static void yyerror(const char *s); -#line 28 "/dev/stdout" +#line 29 "/dev/stdout" #ifndef YYSTYPE typedef int YYSTYPE; @@ -172,6 +173,7 @@ static const short yycheck[] = { 10, #define YYDEBUG 0 #endif #define YYMAXTOKEN 271 +#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a)) #if YYDEBUG static const char *yyname[] = { @@ -184,6 +186,7 @@ static const char *yyname[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,"OP_ADD","\"ADD\"","OP_SUB","\"SUB\"","OP_MUL","\"MUL\"","OP_DIV", "\"DIV\"","OP_MOD","\"MOD\"","OP_AND","\"AND\"","DIGIT","LETTER","UMINUS", +"illegal-symbol", }; static const char *yyrule[] = { "$accept : list", @@ -225,12 +228,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; @@ -283,7 +286,7 @@ yylex(void) { } return( c ); } -#line 286 "/dev/stdout" +#line 288 "/dev/stdout" #if YYDEBUG #include <stdio.h> /* needed for printf */ @@ -307,7 +310,7 @@ static int yygrowstack(YYSTACKDATA *data) else if ((newsize *= 2) > YYMAXDEPTH) newsize = YYMAXDEPTH; - i = data->s_mark - data->s_base; + i = (int) (data->s_mark - data->s_base); newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); if (newss == 0) return -1; @@ -381,9 +384,7 @@ yyloop: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -465,9 +466,7 @@ yyinrecovery: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, error recovery discards token %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -549,7 +548,7 @@ case 18: #line 70 "quote_calc.y" { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 552 "/dev/stdout" +#line 550 "/dev/stdout" } yystack.s_mark -= yym; yystate = *yystack.s_mark; @@ -571,9 +570,7 @@ break; #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, YYFINAL, yychar, yys); } diff --git a/tools/regression/usr.bin/yacc/regress.12.out b/tools/regression/usr.bin/yacc/regress.12.out index d3d03b9..757c977 100644 --- a/tools/regression/usr.bin/yacc/regress.12.out +++ b/tools/regression/usr.bin/yacc/regress.12.out @@ -5,6 +5,7 @@ static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; #define YYBYACC 1 #define YYMAJOR 1 #define YYMINOR 9 +#define YYPATCH 20140101 #define YYEMPTY (-1) #define yyclearin (yychar = YYEMPTY) @@ -25,7 +26,7 @@ int base; int yylex(void); static void yyerror(const char *s); -#line 28 "/dev/stdout" +#line 29 "/dev/stdout" #ifndef YYSTYPE typedef int YYSTYPE; @@ -172,6 +173,7 @@ static const short yycheck[] = { 10, #define YYDEBUG 0 #endif #define YYMAXTOKEN 271 +#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a)) #if YYDEBUG static const char *yyname[] = { @@ -184,6 +186,7 @@ static const char *yyname[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,"OP_ADD","\"ADD\"","OP_SUB","\"SUB\"","OP_MUL","\"MUL\"","OP_DIV", "\"DIV\"","OP_MOD","\"MOD\"","OP_AND","\"AND\"","DIGIT","LETTER","UMINUS", +"illegal-symbol", }; static const char *yyrule[] = { "$accept : list", @@ -225,12 +228,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; @@ -283,7 +286,7 @@ yylex(void) { } return( c ); } -#line 286 "/dev/stdout" +#line 288 "/dev/stdout" #if YYDEBUG #include <stdio.h> /* needed for printf */ @@ -307,7 +310,7 @@ static int yygrowstack(YYSTACKDATA *data) else if ((newsize *= 2) > YYMAXDEPTH) newsize = YYMAXDEPTH; - i = data->s_mark - data->s_base; + i = (int) (data->s_mark - data->s_base); newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); if (newss == 0) return -1; @@ -381,9 +384,7 @@ yyloop: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -465,9 +466,7 @@ yyinrecovery: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, error recovery discards token %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -549,7 +548,7 @@ case 18: #line 70 "quote_calc2.y" { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 552 "/dev/stdout" +#line 550 "/dev/stdout" } yystack.s_mark -= yym; yystate = *yystack.s_mark; @@ -571,9 +570,7 @@ break; #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, YYFINAL, yychar, yys); } diff --git a/tools/regression/usr.bin/yacc/regress.13.out b/tools/regression/usr.bin/yacc/regress.13.out index fc68da8..94b717e 100644 --- a/tools/regression/usr.bin/yacc/regress.13.out +++ b/tools/regression/usr.bin/yacc/regress.13.out @@ -5,6 +5,7 @@ static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; #define YYBYACC 1 #define YYMAJOR 1 #define YYMINOR 9 +#define YYPATCH 20140101 #define YYEMPTY (-1) #define yyclearin (yychar = YYEMPTY) @@ -25,7 +26,7 @@ int base; int yylex(void); static void yyerror(const char *s); -#line 28 "/dev/stdout" +#line 29 "/dev/stdout" #ifndef YYSTYPE typedef int YYSTYPE; @@ -166,6 +167,7 @@ static const short yycheck[] = { 10, #define YYDEBUG 0 #endif #define YYMAXTOKEN 271 +#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a)) #if YYDEBUG static const char *yyname[] = { @@ -178,7 +180,7 @@ static const char *yyname[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,"OP_ADD","\"ADD-operator\"","OP_SUB","\"SUB-operator\"","OP_MUL", "\"MUL-operator\"","OP_DIV","\"DIV-operator\"","OP_MOD","\"MOD-operator\"", -"OP_AND","\"AND-operator\"","DIGIT","LETTER","UMINUS", +"OP_AND","\"AND-operator\"","DIGIT","LETTER","UMINUS","illegal-symbol", }; static const char *yyrule[] = { "$accept : list", @@ -220,12 +222,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; @@ -278,7 +280,7 @@ yylex(void) { } return( c ); } -#line 281 "/dev/stdout" +#line 282 "/dev/stdout" #if YYDEBUG #include <stdio.h> /* needed for printf */ @@ -302,7 +304,7 @@ static int yygrowstack(YYSTACKDATA *data) else if ((newsize *= 2) > YYMAXDEPTH) newsize = YYMAXDEPTH; - i = data->s_mark - data->s_base; + i = (int) (data->s_mark - data->s_base); newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); if (newss == 0) return -1; @@ -376,9 +378,7 @@ yyloop: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -460,9 +460,7 @@ yyinrecovery: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, error recovery discards token %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -544,7 +542,7 @@ case 18: #line 70 "quote_calc3.y" { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 547 "/dev/stdout" +#line 544 "/dev/stdout" } yystack.s_mark -= yym; yystate = *yystack.s_mark; @@ -566,9 +564,7 @@ break; #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, YYFINAL, yychar, yys); } diff --git a/tools/regression/usr.bin/yacc/regress.14.out b/tools/regression/usr.bin/yacc/regress.14.out index 96fdb57..aecfb49 100644 --- a/tools/regression/usr.bin/yacc/regress.14.out +++ b/tools/regression/usr.bin/yacc/regress.14.out @@ -5,6 +5,7 @@ static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; #define YYBYACC 1 #define YYMAJOR 1 #define YYMINOR 9 +#define YYPATCH 20140101 #define YYEMPTY (-1) #define yyclearin (yychar = YYEMPTY) @@ -25,7 +26,7 @@ int base; int yylex(void); static void yyerror(const char *s); -#line 28 "/dev/stdout" +#line 29 "/dev/stdout" #ifndef YYSTYPE typedef int YYSTYPE; @@ -166,6 +167,7 @@ static const short yycheck[] = { 10, #define YYDEBUG 0 #endif #define YYMAXTOKEN 271 +#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a)) #if YYDEBUG static const char *yyname[] = { @@ -178,7 +180,7 @@ static const char *yyname[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,"OP_ADD","\"ADD-operator\"","OP_SUB","\"SUB-operator\"","OP_MUL", "\"MUL-operator\"","OP_DIV","\"DIV-operator\"","OP_MOD","\"MOD-operator\"", -"OP_AND","\"AND-operator\"","DIGIT","LETTER","UMINUS", +"OP_AND","\"AND-operator\"","DIGIT","LETTER","UMINUS","illegal-symbol", }; static const char *yyrule[] = { "$accept : list", @@ -220,12 +222,12 @@ YYSTYPE yylval; #ifdef YYMAXDEPTH #define YYSTACKSIZE YYMAXDEPTH #else -#define YYSTACKSIZE 500 -#define YYMAXDEPTH 500 +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 #endif #endif -#define YYINITSTACKSIZE 500 +#define YYINITSTACKSIZE 200 typedef struct { unsigned stacksize; @@ -278,7 +280,7 @@ yylex(void) { } return( c ); } -#line 281 "/dev/stdout" +#line 282 "/dev/stdout" #if YYDEBUG #include <stdio.h> /* needed for printf */ @@ -302,7 +304,7 @@ static int yygrowstack(YYSTACKDATA *data) else if ((newsize *= 2) > YYMAXDEPTH) newsize = YYMAXDEPTH; - i = data->s_mark - data->s_base; + i = (int) (data->s_mark - data->s_base); newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); if (newss == 0) return -1; @@ -376,9 +378,7 @@ yyloop: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -460,9 +460,7 @@ yyinrecovery: #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, error recovery discards token %d (%s)\n", YYPREFIX, yystate, yychar, yys); } @@ -544,7 +542,7 @@ case 18: #line 70 "quote_calc4.y" { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 547 "/dev/stdout" +#line 544 "/dev/stdout" } yystack.s_mark -= yym; yystate = *yystack.s_mark; @@ -566,9 +564,7 @@ break; #if YYDEBUG if (yydebug) { - yys = 0; - if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; - if (!yys) yys = "illegal-symbol"; + yys = yyname[YYTRANSLATE(yychar)]; printf("%sdebug: state %d, reading %d (%s)\n", YYPREFIX, YYFINAL, yychar, yys); } diff --git a/tools/regression/usr.bin/yacc/regress.sh b/tools/regression/usr.bin/yacc/regress.sh index 4517084..5b004be 100755 --- a/tools/regression/usr.bin/yacc/regress.sh +++ b/tools/regression/usr.bin/yacc/regress.sh @@ -6,21 +6,21 @@ echo 1..15 REGRESSION_START($1) -REGRESSION_TEST(`00', `/usr/obj/usr/src/usr.bin/yacc/yacc -b regress -o /dev/stdout undefined.y') -REGRESSION_TEST(`01', `/usr/obj/usr/src/usr.bin/yacc/yacc -b regress -o /dev/stdout calc.y') -REGRESSION_TEST(`02', `/usr/obj/usr/src/usr.bin/yacc/yacc -b regress -o /dev/stdout calc1.y') -REGRESSION_TEST(`03', `/usr/obj/usr/src/usr.bin/yacc/yacc -b regress -o /dev/stdout calc3.y') -REGRESSION_TEST(`04', `/usr/obj/usr/src/usr.bin/yacc/yacc -b regress -o /dev/stdout code_calc.y') -REGRESSION_TEST(`05', `/usr/obj/usr/src/usr.bin/yacc/yacc -b regress -o /dev/stdout code_error.y') -REGRESSION_TEST(`06', `/usr/obj/usr/src/usr.bin/yacc/yacc -b regress -o /dev/stdout error.y') -REGRESSION_TEST(`07', `/usr/obj/usr/src/usr.bin/yacc/yacc -b regress -o /dev/stdout ftp.y') -REGRESSION_TEST(`08', `/usr/obj/usr/src/usr.bin/yacc/yacc -b regress -o /dev/stdout grammar.y') -REGRESSION_TEST(`09', `/usr/obj/usr/src/usr.bin/yacc/yacc -b regress -o /dev/stdout pure_calc.y') -REGRESSION_TEST(`10', `/usr/obj/usr/src/usr.bin/yacc/yacc -b regress -o /dev/stdout pure_error.y') -REGRESSION_TEST(`11', `/usr/obj/usr/src/usr.bin/yacc/yacc -b regress -o /dev/stdout quote_calc.y') -REGRESSION_TEST(`12', `/usr/obj/usr/src/usr.bin/yacc/yacc -b regress -o /dev/stdout quote_calc2.y') -REGRESSION_TEST(`13', `/usr/obj/usr/src/usr.bin/yacc/yacc -b regress -o /dev/stdout quote_calc3.y') -REGRESSION_TEST(`14', `/usr/obj/usr/src/usr.bin/yacc/yacc -b regress -o /dev/stdout quote_calc4.y') +REGRESSION_TEST(`00', `yacc -b regress -o /dev/stdout undefined.y') +REGRESSION_TEST(`01', `yacc -b regress -o /dev/stdout calc.y') +REGRESSION_TEST(`02', `yacc -b regress -o /dev/stdout calc1.y') +REGRESSION_TEST(`03', `yacc -b regress -o /dev/stdout calc3.y') +REGRESSION_TEST(`04', `yacc -b regress -o /dev/stdout code_calc.y') +REGRESSION_TEST(`05', `yacc -b regress -o /dev/stdout code_error.y') +REGRESSION_TEST(`06', `yacc -b regress -o /dev/stdout error.y') +REGRESSION_TEST(`07', `yacc -b regress -o /dev/stdout ftp.y') +REGRESSION_TEST(`08', `yacc -b regress -o /dev/stdout grammar.y') +REGRESSION_TEST(`09', `yacc -b regress -o /dev/stdout pure_calc.y') +REGRESSION_TEST(`10', `yacc -b regress -o /dev/stdout pure_error.y') +REGRESSION_TEST(`11', `yacc -b regress -o /dev/stdout quote_calc.y') +REGRESSION_TEST(`12', `yacc -b regress -o /dev/stdout quote_calc2.y') +REGRESSION_TEST(`13', `yacc -b regress -o /dev/stdout quote_calc3.y') +REGRESSION_TEST(`14', `yacc -b regress -o /dev/stdout quote_calc4.y') REGRESSION_END() |