Home | History | Annotate | Download | only in tests
      1 #! /bin/sh
      2 ## --------------------- ##
      3 ## M4sh Initialization.  ##
      4 ## --------------------- ##
      5 
      6 # Be Bourne compatible
      7 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
      8   emulate sh
      9   NULLCMD=:
     10   # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
     11   # is contrary to our usage.  Disable this feature.
     12   alias -g '${1+"$@"}'='"$@"'
     13 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
     14   set -o posix
     15 fi
     16 DUALCASE=1; export DUALCASE # for MKS sh
     17 
     18 # Support unset when possible.
     19 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
     20   as_unset=unset
     21 else
     22   as_unset=false
     23 fi
     24 
     25 
     26 # Work around bugs in pre-3.0 UWIN ksh.
     27 $as_unset ENV MAIL MAILPATH
     28 PS1='$ '
     29 PS2='> '
     30 PS4='+ '
     31 
     32 # NLS nuisances.
     33 for as_var in \
     34   LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
     35   LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
     36   LC_TELEPHONE LC_TIME
     37 do
     38   if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
     39     eval $as_var=C; export $as_var
     40   else
     41     $as_unset $as_var
     42   fi
     43 done
     44 
     45 # Required to use basename.
     46 if expr a : '\(a\)' >/dev/null 2>&1; then
     47   as_expr=expr
     48 else
     49   as_expr=false
     50 fi
     51 
     52 if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
     53   as_basename=basename
     54 else
     55   as_basename=false
     56 fi
     57 
     58 
     59 # Name of the executable.
     60 as_me=`$as_basename "$0" ||
     61 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
     62 	 X"$0" : 'X\(//\)$' \| \
     63 	 X"$0" : 'X\(/\)$' \| \
     64 	 .     : '\(.\)' 2>/dev/null ||
     65 echo X/"$0" |
     66     sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
     67   	  /^X\/\(\/\/\)$/{ s//\1/; q; }
     68   	  /^X\/\(\/\).*/{ s//\1/; q; }
     69   	  s/.*/./; q'`
     70 
     71 
     72 # PATH needs CR, and LINENO needs CR and PATH.
     73 # Avoid depending upon Character Ranges.
     74 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
     75 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
     76 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
     77 as_cr_digits='0123456789'
     78 as_cr_alnum=$as_cr_Letters$as_cr_digits
     79 
     80 # The user is always right.
     81 if test "${PATH_SEPARATOR+set}" != set; then
     82   echo "#! /bin/sh" >conf$$.sh
     83   echo  "exit 0"   >>conf$$.sh
     84   chmod +x conf$$.sh
     85   if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
     86     PATH_SEPARATOR=';'
     87   else
     88     PATH_SEPARATOR=:
     89   fi
     90   rm -f conf$$.sh
     91 fi
     92 
     93 
     94   as_lineno_1=$LINENO
     95   as_lineno_2=$LINENO
     96   as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
     97   test "x$as_lineno_1" != "x$as_lineno_2" &&
     98   test "x$as_lineno_3"  = "x$as_lineno_2"  || {
     99   # Find who we are.  Look in the path if we contain no path at all
    100   # relative or not.
    101   case $0 in
    102     *[\\/]* ) as_myself=$0 ;;
    103     *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    104 for as_dir in $PATH
    105 do
    106   IFS=$as_save_IFS
    107   test -z "$as_dir" && as_dir=.
    108   test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
    109 done
    110 
    111        ;;
    112   esac
    113   # We did not find ourselves, most probably we were run as `sh COMMAND'
    114   # in which case we are not to be found in the path.
    115   if test "x$as_myself" = x; then
    116     as_myself=$0
    117   fi
    118   if test ! -f "$as_myself"; then
    119     { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
    120    { (exit 1); exit 1; }; }
    121   fi
    122   case $CONFIG_SHELL in
    123   '')
    124     as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    125 for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
    126 do
    127   IFS=$as_save_IFS
    128   test -z "$as_dir" && as_dir=.
    129   for as_base in sh bash ksh sh5; do
    130 	 case $as_dir in
    131 	 /*)
    132 	   if ("$as_dir/$as_base" -c '
    133   as_lineno_1=$LINENO
    134   as_lineno_2=$LINENO
    135   as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
    136   test "x$as_lineno_1" != "x$as_lineno_2" &&
    137   test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
    138 	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
    139 	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
    140 	     CONFIG_SHELL=$as_dir/$as_base
    141 	     export CONFIG_SHELL
    142 	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
    143 	   fi;;
    144 	 esac
    145        done
    146 done
    147 ;;
    148   esac
    149 
    150   # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
    151   # uniformly replaced by the line number.  The first 'sed' inserts a
    152   # line-number line before each line; the second 'sed' does the real
    153   # work.  The second script uses 'N' to pair each line-number line
    154   # with the numbered line, and appends trailing '-' during
    155   # substitution so that $LINENO is not a special case at line end.
    156   # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
    157   # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
    158   sed '=' <$as_myself |
    159     sed '
    160       N
    161       s,$,-,
    162       : loop
    163       s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
    164       t loop
    165       s,-$,,
    166       s,^['$as_cr_digits']*\n,,
    167     ' >$as_me.lineno &&
    168   chmod +x $as_me.lineno ||
    169     { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
    170    { (exit 1); exit 1; }; }
    171 
    172   # Don't try to exec as it changes $[0], causing all sort of problems
    173   # (the dirname of $[0] is not the place where we might find the
    174   # original and so on.  Autoconf is especially sensible to this).
    175   . ./$as_me.lineno
    176   # Exit status is that of the last command.
    177   exit
    178 }
    179 
    180 
    181 case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
    182   *c*,-n*) ECHO_N= ECHO_C='
    183 ' ECHO_T='	' ;;
    184   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
    185   *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
    186 esac
    187 
    188 if expr a : '\(a\)' >/dev/null 2>&1; then
    189   as_expr=expr
    190 else
    191   as_expr=false
    192 fi
    193 
    194 rm -f conf$$ conf$$.exe conf$$.file
    195 echo >conf$$.file
    196 if ln -s conf$$.file conf$$ 2>/dev/null; then
    197   # We could just check for DJGPP; but this test a) works b) is more generic
    198   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
    199   if test -f conf$$.exe; then
    200     # Don't use ln at all; we don't have any links
    201     as_ln_s='cp -p'
    202   else
    203     as_ln_s='ln -s'
    204   fi
    205 elif ln conf$$.file conf$$ 2>/dev/null; then
    206   as_ln_s=ln
    207 else
    208   as_ln_s='cp -p'
    209 fi
    210 rm -f conf$$ conf$$.exe conf$$.file
    211 
    212 if mkdir -p . 2>/dev/null; then
    213   as_mkdir_p=:
    214 else
    215   test -d ./-p && rmdir ./-p
    216   as_mkdir_p=false
    217 fi
    218 
    219 as_executable_p="test -f"
    220 
    221 # Sed expression to map a string onto a valid CPP name.
    222 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
    223 
    224 # Sed expression to map a string onto a valid variable name.
    225 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
    226 
    227 
    228 # IFS
    229 # We need space, tab and new line, in precisely that order.
    230 as_nl='
    231 '
    232 IFS=" 	$as_nl"
    233 
    234 # CDPATH.
    235 $as_unset CDPATH
    236 
    237 
    238 SHELL=${CONFIG_SHELL-/bin/sh}
    239 
    240 # How were we run?
    241 at_cli_args="$@"
    242 
    243 # Load the config file.
    244 for at_file in atconfig atlocal
    245 do
    246   test -r $at_file || continue
    247   . ./$at_file || { echo "$as_me: error: invalid content: $at_file" >&2
    248    { (exit 1); exit 1; }; }
    249 done
    250 
    251 # atconfig delivers paths relative to the directory the test suite is
    252 # in, but the groups themselves are run in testsuite-dir/group-dir.
    253 if test -n "$at_top_srcdir"; then
    254   builddir=../..
    255   for at_dir in srcdir top_srcdir top_builddir
    256   do
    257     at_val=`eval echo '${'at_$at_dir'}'`
    258     eval "$at_dir=\$at_val/../.."
    259   done
    260 fi
    261 
    262 # Not all shells have the 'times' builtin; the subshell is needed to make
    263 # sure we discard the 'times: not found' message from the shell.
    264 at_times_p=false
    265 (times) >/dev/null 2>&1 && at_times_p=:
    266 
    267 # CLI Arguments to pass to the debugging scripts.
    268 at_debug_args=
    269 # -e sets to true
    270 at_errexit_p=false
    271 # Shall we be verbose?
    272 at_verbose=:
    273 at_quiet=echo
    274 
    275 # Shall we keep the debug scripts?  Must be `:' when the suite is
    276 # run by a debug script, so that the script doesn't remove itself.
    277 at_debug_p=false
    278 # Display help message?
    279 at_help_p=false
    280 # List test groups?
    281 at_list_p=false
    282 # Test groups to run
    283 at_groups=
    284 
    285 # The directory we are in.
    286 at_dir=`pwd`
    287 # The directory the whole suite works in.
    288 # Should be absolutely to let the user `cd' at will.
    289 at_suite_dir=$at_dir/$as_me.dir
    290 # The file containing the suite.
    291 at_suite_log=$at_dir/$as_me.log
    292 # The file containing the location of the last AT_CHECK.
    293 at_check_line_file=$at_suite_dir/at-check-line
    294 # The file containing the exit status of the last command.
    295 at_status_file=$at_suite_dir/at-status
    296 # The files containing the output of the tested commands.
    297 at_stdout=$at_suite_dir/at-stdout
    298 at_stder1=$at_suite_dir/at-stder1
    299 at_stderr=$at_suite_dir/at-stderr
    300 # The file containing dates.
    301 at_times_file=$at_suite_dir/at-times
    302 
    303 # List of the tested programs.
    304 at_tested='bison'
    305 # List of the all the test groups.
    306 at_groups_all=' banner-1 1 2 3 4 5 6 7 8 9 10 banner-2 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 banner-3 31 32 33 34 banner-4 35 36 37 38 39 40 banner-5 41 42 43 44 45 banner-6 46 47 48 49 banner-7 50 51 52 53 54 55 56 57 banner-8 58 59 60 61 62 63 64 65 66 67 68 69 banner-9 70 71 72 73 74 75 76 77 78 79 80 81 82 83 banner-10 84 85 86 87 88 89 90 91 92 93 94 95 96 97 banner-11 98 99 100 101 102 banner-12 103 104 banner-13 105 106 107 108 109 banner-14 110 111 112 banner-15 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 banner-16 131 132 banner-17 133 134 135 136 137 138 139 140 141 banner-18 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158'
    307 # As many dots as there are digits in the last test group number.
    308 # Used to normalize the test group numbers so that `ls' lists them in
    309 # numerical order.
    310 at_format='...'
    311 # Description of all the test groups.
    312 at_help_all='1;input.at:28;Invalid dollar-n;;
    313 2;input.at:46;Invalid @n;;
    314 3;input.at:64;Type Clashes;;
    315 4;input.at:89;Unused values;;
    316 5;input.at:157;Incompatible Aliases;;
    317 6;input.at:198;Torturing the Scanner;;
    318 7;input.at:357;Typed symbol aliases;;
    319 8;input.at:393;Require 1.0;;
    320 9;input.at:394;Require 2.3;;
    321 10;input.at:396;Require 100.0;;
    322 11;output.at:43;Output files:  -dv ;;
    323 12;output.at:46;Output files:  -dv >&-;;
    324 13;output.at:48;Output files:  -dv -o foo.c ;;
    325 14;output.at:50;Output files:  -dv -o foo.tab.c ;;
    326 15;output.at:52;Output files:  -dv -y ;;
    327 16;output.at:54;Output files:  -dv -b bar ;;
    328 17;output.at:56;Output files:  -dv -g -o foo.c ;;
    329 18;output.at:60;Output files: %defines %verbose  ;;
    330 19;output.at:62;Output files: %defines %verbose %yacc  ;;
    331 20;output.at:65;Output files: %defines %verbose %yacc  ;;
    332 21;output.at:69;Output files: %file-prefix="bar" %defines %verbose  ;;
    333 22;output.at:71;Output files: %output="bar.c" %defines %verbose %yacc  ;;
    334 23;output.at:75;Output files: %file-prefix="baz" %output="bar.c" %defines %verbose %yacc  ;;
    335 24;output.at:80;Output files: %defines %verbose  ;;
    336 25;output.at:83;Output files: %defines %verbose  -o foo.c ;;
    337 26;output.at:87;Output files:  --defines=foo.hpp -o foo.c++ ;;
    338 27;output.at:91;Output files:  -o foo.c++ --graph=foo.gph ;;
    339 28;output.at:105;Output files: %skeleton "lalr1.cc" %defines %verbose  ;;
    340 29;output.at:109;Output files: %skeleton "lalr1.cc" %defines %verbose  ;;
    341 30;output.at:114;Output files: %skeleton "lalr1.cc" %defines %verbose -o subdir/foo.cc ;;
    342 31;sets.at:66;Nullable;;
    343 32;sets.at:151;Broken Closure;;
    344 33;sets.at:193;Firsts;;
    345 34;sets.at:269;Accept;;
    346 35;reduce.at:26;Useless Terminals;;
    347 36;reduce.at:70;Useless Nonterminals;;
    348 37;reduce.at:125;Useless Rules;report;
    349 38;reduce.at:212;Reduced Automaton;report;
    350 39;reduce.at:301;Underivable Rules;report;
    351 40;reduce.at:342;Empty Language;;
    352 41;synclines.at:95;Prologue synch line;;
    353 42;synclines.at:115;%union synch line;;
    354 43;synclines.at:138;Postprologue synch line;;
    355 44;synclines.at:157;Action synch line;;
    356 45;synclines.at:175;Epilogue synch line;;
    357 46;headers.at:27;%union and --defines;;
    358 47;headers.at:77;Invalid CPP guards: input/input;;
    359 48;headers.at:78;Invalid CPP guards: 9foo;;
    360 49;headers.at:87;export YYLTYPE;;
    361 50;actions.at:25;Mid-rule actions;;
    362 51;actions.at:91;Exotic Dollars;;
    363 52;actions.at:527;Printers and Destructors : ;;
    364 53;actions.at:528;Printers and Destructors with union: ;;
    365 54;actions.at:533;Printers and Destructors : %defines %skeleton "lalr1.cc";c++;
    366 55;actions.at:534;Printers and Destructors with union: %defines %skeleton "lalr1.cc";c++;
    367 56;actions.at:536;Printers and Destructors : %glr-parser;;
    368 57;actions.at:537;Printers and Destructors with union: %glr-parser;;
    369 58;conflicts.at:32;S/R in initial;;
    370 59;conflicts.at:52;%nonassoc and eof;;
    371 60;conflicts.at:128;Unresolved SR Conflicts;report;
    372 61;conflicts.at:235;Resolved SR Conflicts;report;
    373 62;conflicts.at:357;Defaulted Conflicted Reduction;report;
    374 63;conflicts.at:476;%expect not enough;;
    375 64;conflicts.at:496;%expect right;;
    376 65;conflicts.at:513;%expect too much;;
    377 66;conflicts.at:533;%expect with reduce conflicts;;
    378 67;conflicts.at:553;%no-default-prec without %prec;;
    379 68;conflicts.at:579;%no-default-prec with %prec;;
    380 69;conflicts.at:603;%default-prec;;
    381 70;calc.at:550;Calculator ;;
    382 71;calc.at:552;Calculator %defines;;
    383 72;calc.at:553;Calculator %locations;;
    384 73;calc.at:554;Calculator %name-prefix="calc";;
    385 74;calc.at:555;Calculator %verbose;;
    386 75;calc.at:556;Calculator %yacc;;
    387 76;calc.at:557;Calculator %error-verbose;;
    388 77;calc.at:559;Calculator %pure-parser %locations;;
    389 78;calc.at:560;Calculator %error-verbose %locations;;
    390 79;calc.at:562;Calculator %error-verbose %locations %defines %name-prefix="calc" %verbose %yacc;;
    391 80;calc.at:564;Calculator %debug;;
    392 81;calc.at:565;Calculator %error-verbose %debug %locations %defines %name-prefix="calc" %verbose %yacc;;
    393 82;calc.at:567;Calculator %pure-parser %error-verbose %debug %locations %defines %name-prefix="calc" %verbose %yacc;;
    394 83;calc.at:569;Calculator %pure-parser %error-verbose %debug %locations %defines %name-prefix="calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count};;
    395 84;calc.at:586;Calculator %glr-parser ;;
    396 85;calc.at:588;Calculator %glr-parser %defines;;
    397 86;calc.at:589;Calculator %glr-parser %locations;;
    398 87;calc.at:590;Calculator %glr-parser %name-prefix="calc";;
    399 88;calc.at:591;Calculator %glr-parser %verbose;;
    400 89;calc.at:592;Calculator %glr-parser %yacc;;
    401 90;calc.at:593;Calculator %glr-parser %error-verbose;;
    402 91;calc.at:595;Calculator %glr-parser %pure-parser %locations;;
    403 92;calc.at:596;Calculator %glr-parser %error-verbose %locations;;
    404 93;calc.at:598;Calculator %glr-parser %error-verbose %locations %defines %name-prefix="calc" %verbose %yacc;;
    405 94;calc.at:600;Calculator %glr-parser %debug;;
    406 95;calc.at:601;Calculator %glr-parser %error-verbose %debug %locations %defines %name-prefix="calc" %verbose %yacc;;
    407 96;calc.at:603;Calculator %glr-parser %pure-parser %error-verbose %debug %locations %defines %name-prefix="calc" %verbose %yacc;;
    408 97;calc.at:605;Calculator %glr-parser %pure-parser %error-verbose %debug %locations %defines %name-prefix="calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count};;
    409 98;calc.at:621;Calculator %skeleton "lalr1.cc" %defines %locations ;c++;
    410 99;calc.at:622;Calculator %skeleton "lalr1.cc" %defines %locations %error-verbose %name-prefix="calc" %verbose %yacc;c++;
    411 100;calc.at:624;Calculator %skeleton "lalr1.cc" %defines %locations %error-verbose %debug %name-prefix="calc" %verbose %yacc;c++;
    412 101;calc.at:626;Calculator %skeleton "lalr1.cc" %defines %locations %pure-parser %error-verbose %debug %name-prefix="calc" %verbose %yacc;c++;
    413 102;calc.at:628;Calculator %skeleton "lalr1.cc" %defines %locations %pure-parser %error-verbose %debug %name-prefix="calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count};c++;
    414 103;calc.at:651;Calculator %skeleton "glr.cc" %defines %locations %pure-parser %error-verbose %debug %name-prefix="calc" %verbose %yacc;c++;
    415 104;calc.at:653;Calculator %skeleton "glr.cc" %defines %locations %pure-parser %error-verbose %debug %name-prefix="calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count};c++;
    416 105;torture.at:140;Big triangle;;
    417 106;torture.at:232;Big horizontal;;
    418 107;torture.at:368;Many look-ahead tokens;;
    419 108;torture.at:445;Exploding the Stack Size with Alloca;;
    420 109;torture.at:471;Exploding the Stack Size with Malloc;;
    421 110;existing.at:26;GNU AWK Grammar;;
    422 111;existing.at:364;GNU Cim Grammar;;
    423 112;existing.at:980;GNU pic Grammar;;
    424 113;regression.at:28;Trivial grammars;;
    425 114;regression.at:57;Early token definitions;;
    426 115;regression.at:95;Braces parsing;;
    427 116;regression.at:117;Duplicate string;;
    428 117;regression.at:143;Rule Line Numbers;report;
    429 118;regression.at:287;Mixing %token styles;;
    430 119;regression.at:310;Invalid inputs;;
    431 120;regression.at:336;Invalid inputs with {};;
    432 121;regression.at:363;Token definitions;;
    433 122;regression.at:416;Characters Escapes;;
    434 123;regression.at:447;Web2c Report;report;
    435 124;regression.at:624;Web2c Actions;report;
    436 125;regression.at:866;Dancer ;;
    437 126;regression.at:867;Dancer %glr-parser;;
    438 127;regression.at:868;Dancer %skeleton "lalr1.cc";c++;
    439 128;regression.at:963;Expecting two tokens ;;
    440 129;regression.at:964;Expecting two tokens %glr-parser;;
    441 130;regression.at:965;Expecting two tokens %skeleton "lalr1.cc";c++;
    442 131;c++.at:102;Doxygen Public Documentation;;
    443 132;c++.at:103;Doxygen Private Documentation;;
    444 133;cxx-type.at:412;GLR: Resolve ambiguity, impure, no locations;;
    445 134;cxx-type.at:419;GLR: Resolve ambiguity, impure, locations;;
    446 135;cxx-type.at:425;GLR: Resolve ambiguity, pure, no locations;;
    447 136;cxx-type.at:432;GLR: Resolve ambiguity, pure, locations;;
    448 137;cxx-type.at:439;GLR: Merge conflicting parses, impure, no locations;;
    449 138;cxx-type.at:446;GLR: Merge conflicting parses, impure, locations;;
    450 139;cxx-type.at:453;GLR: Merge conflicting parses, pure, no locations;;
    451 140;cxx-type.at:459;GLR: Merge conflicting parses, pure, locations;;
    452 141;cxx-type.at:466;GLR: Verbose messages, resolve ambiguity, impure, no locations;;
    453 142;glr-regression.at:25;Badly Collapsed GLR States;;
    454 143;glr-regression.at:116;Improper handling of embedded actions and dollar(-N) in GLR parsers;;
    455 144;glr-regression.at:232;Improper merging of GLR delayed action sets;;
    456 145;glr-regression.at:337;Duplicate representation of merged trees;;
    457 146;glr-regression.at:432;User destructor for unresolved GLR semantic value;;
    458 147;glr-regression.at:502;User destructor after an error during a split parse;;
    459 148;glr-regression.at:566;Duplicated user destructor for lookahead;;
    460 149;glr-regression.at:644;Incorrectly initialized location for empty right-hand side in GLR;;
    461 150;glr-regression.at:740;No users destructors if stack 0 deleted;;
    462 151;glr-regression.at:820;Corrupted semantic options if user action cuts parse;;
    463 152;glr-regression.at:881;Undesirable destructors if user action cuts parse;;
    464 153;glr-regression.at:947;Leaked semantic values if user action cuts parse;;
    465 154;glr-regression.at:1078;Incorrect lookahead during deterministic GLR;;
    466 155;glr-regression.at:1212;Incorrect lookahead during nondeterministic GLR;;
    467 156;glr-regression.at:1429;Leaked semantic values when reporting ambiguity;;
    468 157;glr-regression.at:1519;Leaked lookahead after nondeterministic parse syntax error;;
    469 158;glr-regression.at:1585;Uninitialized location when reporting ambiguity;;
    470 '
    471 
    472 at_keywords=
    473 at_prev=
    474 for at_option
    475 do
    476   # If the previous option needs an argument, assign it.
    477   if test -n "$at_prev"; then
    478     at_option=$at_prev=$at_option
    479     at_prev=
    480   fi
    481 
    482   at_optarg=`expr "x$at_option" : 'x[^=]*=\(.*\)'`
    483 
    484   # Accept the important Cygnus configure options, so we can diagnose typos.
    485 
    486   case $at_option in
    487     --help | -h )
    488 	at_help_p=:
    489 	;;
    490 
    491     --list | -l )
    492 	at_list_p=:
    493 	;;
    494 
    495     --version | -V )
    496 	echo "$as_me (GNU Bison 2.3)"
    497 	exit 0
    498 	;;
    499 
    500     --clean | -c )
    501 	rm -rf $at_suite_dir $at_suite_log
    502 	exit 0
    503 	;;
    504 
    505     --debug | -d )
    506 	at_debug_p=:
    507 	;;
    508 
    509     --errexit | -e )
    510 	at_debug_p=:
    511 	at_errexit_p=:
    512 	;;
    513 
    514     --verbose | -v )
    515 	at_verbose=echo; at_quiet=:
    516 	;;
    517 
    518     --trace | -x )
    519 	at_traceon='set -vx'; at_traceoff='set +vx'
    520 	;;
    521 
    522     [0-9] | [0-9][0-9] | [0-9][0-9][0-9] | [0-9][0-9][0-9][0-9])
    523 	at_groups="$at_groups$at_option "
    524 	;;
    525 
    526     # Ranges
    527     [0-9]- | [0-9][0-9]- | [0-9][0-9][0-9]- | [0-9][0-9][0-9][0-9]-)
    528 	at_range_start=`echo $at_option |tr -d '-'`
    529 	at_range=`echo " $at_groups_all " | \
    530 	  sed -e 's,^.* '$at_range_start' ,'$at_range_start' ,'`
    531 	at_groups="$at_groups$at_range "
    532 	;;
    533 
    534     -[0-9] | -[0-9][0-9] | -[0-9][0-9][0-9] | -[0-9][0-9][0-9][0-9])
    535 	at_range_end=`echo $at_option |tr -d '-'`
    536 	at_range=`echo " $at_groups_all " | \
    537 	  sed -e 's, '$at_range_end' .*$, '$at_range_end','`
    538 	at_groups="$at_groups$at_range "
    539 	;;
    540 
    541     [0-9]-[0-9] | [0-9]-[0-9][0-9] | [0-9]-[0-9][0-9][0-9] | \
    542     [0-9]-[0-9][0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9] | \
    543     [0-9][0-9]-[0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9][0-9][0-9] | \
    544     [0-9][0-9][0-9]-[0-9][0-9][0-9] | \
    545     [0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] | \
    546     [0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] )
    547 	at_range_start=`echo $at_option |sed 's,-.*,,'`
    548 	at_range_end=`echo $at_option |sed 's,.*-,,'`
    549 	# FIXME: Maybe test to make sure start <= end?
    550 	at_range=`echo " $at_groups_all " | \
    551 	  sed -e 's,^.* '$at_range_start' ,'$at_range_start' ,' \
    552 	      -e 's, '$at_range_end' .*$, '$at_range_end','`
    553 	at_groups="$at_groups$at_range "
    554 	;;
    555 
    556     # Keywords.
    557     --keywords | -k )
    558 	at_prev=--keywords
    559 	;;
    560     --keywords=* )
    561 	at_keywords="$at_keywords,$at_optarg"
    562 	;;
    563 
    564     *=*)
    565   	at_envvar=`expr "x$at_option" : 'x\([^=]*\)='`
    566   	# Reject names that are not valid shell variable names.
    567   	expr "x$at_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
    568   	  { echo "$as_me: error: invalid variable name: $at_envvar" >&2
    569    { (exit 1); exit 1; }; }
    570   	at_value=`echo "$at_optarg" | sed "s/'/'\\\\\\\\''/g"`
    571   	eval "$at_envvar='$at_value'"
    572   	export $at_envvar
    573 	# Propagate to debug scripts.
    574   	at_debug_args="$at_debug_args $at_option"
    575   	;;
    576 
    577      *) echo "$as_me: invalid option: $at_option" >&2
    578 	echo "Try \`$0 --help' for more information." >&2
    579 	exit 1
    580 	;;
    581   esac
    582 done
    583 
    584 # Process the --keywords
    585 if test -n "$at_keywords"; then
    586   at_groups_selected=$at_help_all
    587   for at_keyword in `IFS=,; set X $at_keywords; shift; echo ${1+$@}`
    588   do
    589     # It is on purpose that we match the test group titles too.
    590     at_groups_selected=`echo "$at_groups_selected" |
    591 			grep -i "^[^;]*;[^;]*.*[; ]$at_keyword[ ;]"`
    592   done
    593   at_groups_selected=`echo "$at_groups_selected" | sed 's/;.*//'`
    594   # Smash the end of lines.
    595   at_groups_selected=`echo $at_groups_selected`
    596   at_groups="$at_groups$at_groups_selected "
    597 fi
    598 
    599 # Selected test groups.
    600 test -z "$at_groups" && at_groups=$at_groups_all
    601 
    602 # Help message.
    603 if $at_help_p; then
    604   cat <<_ATEOF
    605 Usage: $0 [OPTION]... [VARIABLE=VALUE]... [TESTS]
    606 
    607 Run all the tests, or the selected TESTS, and save a detailed log file.
    608 Upon failure, create debugging scripts.
    609 
    610 You should not change environment variables unless explicitly passed
    611 as command line arguments.  Set \`AUTOTEST_PATH' to select the executables
    612 to exercise.  Each relative directory is expanded as build and source
    613 directories relatively to the top level of this distribution.  E.g.,
    614 
    615   $ $0 AUTOTEST_PATH=bin
    616 
    617 possibly amounts into
    618 
    619   PATH=/tmp/foo-1.0/bin:/src/foo-1.0/bin:\$PATH
    620 _ATEOF
    621 cat <<_ATEOF
    622 
    623 Operation modes:
    624   -h, --help     print the help message, then exit
    625   -V, --version  print version number, then exit
    626   -c, --clean    remove all the files this test suite might create and exit
    627   -l, --list     describes all the tests, or the selected TESTS
    628 _ATEOF
    629 cat <<_ATEOF
    630 
    631 Execution tuning:
    632   -k, --keywords=KEYWORDS
    633 	         select the tests matching all the comma separated KEYWORDS
    634 	         accumulates
    635   -e, --errexit  abort as soon as a test fails; implies --debug
    636   -v, --verbose  force more detailed output
    637 	         default for debugging scripts
    638   -d, --debug    inhibit clean up and debug script creation
    639 	         default for debugging scripts
    640   -x, --trace    enable tests shell tracing
    641 _ATEOF
    642 cat <<_ATEOF
    643 
    644 Report bugs to <bug-bison@gnu.org>.
    645 _ATEOF
    646   exit 0
    647 fi
    648 
    649 # List of tests.
    650 if $at_list_p; then
    651   cat <<_ATEOF
    652 GNU Bison 2.3 test suite test groups:
    653 
    654  NUM: FILENAME:LINE      TEST-GROUP-NAME
    655       KEYWORDS
    656 
    657 _ATEOF
    658   # "  1 42  45 " => "^(1|42|45);".
    659   at_groups_pattern=`echo "$at_groups" | sed 's/^  *//;s/  *$//;s/  */|/g'`
    660   echo "$at_help_all" |
    661     awk 'BEGIN { FS = ";" }
    662 	 { if ($1 !~ /^('"$at_groups_pattern"')$/) next }
    663 	 { if ($1) printf " %3d: %-18s %s\n", $1, $2, $3
    664 	   if ($4) printf "      %s\n", $4 } '
    665   exit 0
    666 fi
    667 
    668 # Don't take risks: use only absolute directories in PATH.
    669 #
    670 # For stand-alone test suites, AUTOTEST_PATH is relative to `.'.
    671 #
    672 # For embedded test suites, AUTOTEST_PATH is relative to the top level
    673 # of the package.  Then expand it into build/src parts, since users
    674 # may create executables in both places.
    675 #
    676 # There might be directories that don't exist, but don't redirect
    677 # builtins' (eg., cd) stderr directly: Ultrix's sh hates that.
    678 AUTOTEST_PATH=`echo $AUTOTEST_PATH | tr ':' $PATH_SEPARATOR`
    679 at_path=
    680 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    681 for as_dir in $AUTOTEST_PATH $PATH
    682 do
    683   IFS=$as_save_IFS
    684   test -z "$as_dir" && as_dir=.
    685   case $as_dir in
    686   [\\/]* | ?:[\\/]* )
    687     at_path=$at_path$PATH_SEPARATOR$as_dir
    688     ;;
    689   * )
    690     if test -z "$at_top_builddir"; then
    691       # Stand-alone test suite.
    692       at_path=$at_path$PATH_SEPARATOR$as_dir
    693     else
    694       # Embedded test suite.
    695       at_path=$at_path$PATH_SEPARATOR$at_top_builddir/$as_dir
    696       at_path=$at_path$PATH_SEPARATOR$at_top_srcdir/$as_dir
    697     fi
    698     ;;
    699 esac
    700 done
    701 
    702 
    703 # Now build and simplify PATH.
    704 PATH=
    705 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    706 for as_dir in $at_path
    707 do
    708   IFS=$as_save_IFS
    709   test -z "$as_dir" && as_dir=.
    710   as_dir=`(cd "$as_dir" && pwd) 2>/dev/null`
    711 test -d "$as_dir" || continue
    712 case $PATH in
    713 	          $as_dir                 | \
    714 	          $as_dir$PATH_SEPARATOR* | \
    715   *$PATH_SEPARATOR$as_dir                 | \
    716   *$PATH_SEPARATOR$as_dir$PATH_SEPARATOR* ) ;;
    717 
    718   '') PATH=$as_dir ;;
    719    *) PATH=$PATH$PATH_SEPARATOR$as_dir ;;
    720 esac
    721 done
    722 
    723 export PATH
    724 
    725 # Setting up the FDs.
    726 # 5 is the log file.  Not to be overwritten if `-d'.
    727 
    728 $at_debug_p && at_suite_log=/dev/null
    729 exec 5>$at_suite_log
    730 
    731 # Banners and logs.
    732 cat <<\_ASBOX
    733 ## ------------------------- ##
    734 ## GNU Bison 2.3 test suite. ##
    735 ## ------------------------- ##
    736 _ASBOX
    737 {
    738   cat <<\_ASBOX
    739 ## ------------------------- ##
    740 ## GNU Bison 2.3 test suite. ##
    741 ## ------------------------- ##
    742 _ASBOX
    743   echo
    744 
    745   echo "$as_me: command line was:"
    746   echo "  $ $0 $at_cli_args"
    747   echo
    748 
    749   # Try to find a few ChangeLogs in case it might help determining the
    750   # exact version.  Use the relative dir: if the top dir is a symlink,
    751   # find will not follow it (and options to follow the links are not
    752   # portable), which would result in no output here.
    753   if test -n "$at_top_srcdir"; then
    754     cat <<\_ASBOX
    755 ## ----------- ##
    756 ## ChangeLogs. ##
    757 ## ----------- ##
    758 _ASBOX
    759     echo
    760     for at_file in `find "$at_top_srcdir" -name ChangeLog -print`
    761     do
    762       echo "$as_me: $at_file:"
    763       sed 's/^/| /;10q' $at_file
    764       echo
    765     done
    766 
    767     {
    768 cat <<_ASUNAME
    769 ## --------- ##
    770 ## Platform. ##
    771 ## --------- ##
    772 
    773 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
    774 uname -m = `(uname -m) 2>/dev/null || echo unknown`
    775 uname -r = `(uname -r) 2>/dev/null || echo unknown`
    776 uname -s = `(uname -s) 2>/dev/null || echo unknown`
    777 uname -v = `(uname -v) 2>/dev/null || echo unknown`
    778 
    779 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
    780 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
    781 
    782 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
    783 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
    784 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
    785 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
    786 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
    787 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
    788 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
    789 
    790 _ASUNAME
    791 
    792 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    793 for as_dir in $PATH
    794 do
    795   IFS=$as_save_IFS
    796   test -z "$as_dir" && as_dir=.
    797   echo "PATH: $as_dir"
    798 done
    799 
    800 }
    801     echo
    802   fi
    803 
    804   # Contents of the config files.
    805   for at_file in atconfig atlocal
    806   do
    807     test -r $at_file || continue
    808     echo "$as_me: $at_file:"
    809     sed 's/^/| /' $at_file
    810     echo
    811   done
    812 
    813   cat <<\_ASBOX
    814 ## ---------------- ##
    815 ## Tested programs. ##
    816 ## ---------------- ##
    817 _ASBOX
    818   echo
    819 } >&5
    820 
    821 # Report what programs are being tested.
    822 for at_program in : $at_tested
    823 do
    824   test "$at_program" = : && continue
    825   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
    826 for as_dir in $PATH
    827 do
    828   IFS=$as_save_IFS
    829   test -z "$as_dir" && as_dir=.
    830   test -f $as_dir/$at_program && break
    831 done
    832 
    833   if test -f $as_dir/$at_program; then
    834     {
    835       echo "local.at:216: $as_dir/$at_program --version"
    836       $as_dir/$at_program --version
    837       echo
    838     } >&5 2>&1
    839   else
    840     { { echo "$as_me:$LINENO: error: cannot find $at_program" >&5
    841 echo "$as_me: error: cannot find $at_program" >&2;}
    842    { (exit 1); exit 1; }; }
    843   fi
    844 done
    845 
    846 {
    847   cat <<\_ASBOX
    848 ## ------------------ ##
    849 ## Running the tests. ##
    850 ## ------------------ ##
    851 _ASBOX
    852 } >&5
    853 
    854 at_start_date=`date`
    855 at_start_time=`(date +%s) 2>/dev/null`
    856 echo "$as_me: starting at: $at_start_date" >&5
    857 at_xpass_list=
    858 at_xfail_list=
    859 at_pass_list=
    860 at_fail_list=
    861 at_skip_list=
    862 at_group_count=0
    863 
    864 # Create the master directory if it doesn't already exist.
    865 test -d $at_suite_dir ||
    866   mkdir $at_suite_dir ||
    867   { { echo "$as_me:$LINENO: error: cannot create $at_suite_dir" >&5
    868 echo "$as_me: error: cannot create $at_suite_dir" >&2;}
    869    { (exit 1); exit 1; }; }
    870 
    871 # Can we diff with `/dev/null'?  DU 5.0 refuses.
    872 if diff /dev/null /dev/null >/dev/null 2>&1; then
    873   at_devnull=/dev/null
    874 else
    875   at_devnull=$at_suite_dir/devnull
    876   cp /dev/null $at_devnull
    877 fi
    878 
    879 # Use `diff -u' when possible.
    880 if diff -u $at_devnull $at_devnull >/dev/null 2>&1; then
    881   at_diff='diff -u'
    882 else
    883   at_diff=diff
    884 fi
    885 
    886 
    887 for at_group in $at_groups
    888 do
    889   # Be sure to come back to the top test directory.
    890   cd $at_suite_dir
    891 
    892   case $at_group in
    893     banner-*)
    894       at_group_log=$at_suite_log
    895       ;;
    896 
    897     *)
    898       # Skip tests we already run (using --keywords makes it easy to get
    899       # duplication).
    900       case " $at_pass_test $at_skip_test $at_fail_test " in
    901 	*" $at_group "* ) continue;;
    902       esac
    903 
    904       # Normalize the test group number.
    905       at_group_normalized=`expr "00000$at_group" : ".*\($at_format\)"`
    906 
    907       # Create a fresh directory for the next test group, and enter.
    908       at_group_dir=$at_suite_dir/$at_group_normalized
    909       at_group_log=$at_group_dir/$as_me.log
    910       rm -rf $at_group_dir
    911       mkdir $at_group_dir ||
    912 	{ { echo "$as_me:$LINENO: error: cannot create $at_group_dir" >&5
    913 echo "$as_me: error: cannot create $at_group_dir" >&2;}
    914    { (exit 1); exit 1; }; }
    915       cd $at_group_dir
    916       ;;
    917   esac
    918 
    919   echo 0 > $at_status_file
    920 
    921   # Clearly separate the test groups when verbose.
    922   test $at_group_count != 0 && $at_verbose
    923 
    924   # In verbose mode, append to the log file *and* show on
    925   # the standard output; in quiet mode only write to the log
    926   if test $at_verbose = echo; then
    927     at_tee_pipe="tee -a $at_group_log"
    928   else
    929     at_tee_pipe="cat >> $at_group_log"
    930   fi
    931 
    932   case $at_group in
    933 
    934   banner-1 ) # Banner 1. input.at:19
    935     cat <<\_ATEOF
    936 
    937 Input Processing.
    938 
    939 _ATEOF
    940     ;;
    941 
    942   1 ) # 1. input.at:28: Invalid dollar-n
    943     at_setup_line='input.at:28'
    944     at_desc='Invalid dollar-n'
    945     $at_quiet $ECHO_N "  1: Invalid dollar-n                             $ECHO_C"
    946     at_xfail=no
    947     (
    948       echo "1. input.at:28: testing ..."
    949       $at_traceon
    950 
    951 
    952 cat >input.y <<'_ATEOF'
    953 %%
    954 exp: { $$ = $1 ; };
    955 _ATEOF
    956 
    957 
    958 $at_traceoff
    959 echo "input.at:37: bison input.y"
    960 echo input.at:37 >$at_check_line_file
    961 ( $at_traceon; bison input.y ) >$at_stdout 2>$at_stder1
    962 at_status=$?
    963 grep '^ *+' $at_stder1 >&2
    964 grep -v '^ *+' $at_stder1 >$at_stderr
    965 at_failed=false
    966 echo >>$at_stderr; echo "input.y:2.13-14: integer out of range: \`\$1'
    967 " | $at_diff - $at_stderr || at_failed=:
    968 $at_diff $at_devnull $at_stdout || at_failed=:
    969 case $at_status in
    970    77) echo 77 > $at_status_file
    971             exit 77;;
    972    1) ;;
    973    *) echo "input.at:37: exit code was $at_status, expected 1"
    974       at_failed=:;;
    975 esac
    976 if $at_failed; then
    977 
    978   echo 1 > $at_status_file
    979   exit 1
    980 fi
    981 
    982 $at_traceon
    983 
    984 
    985       $at_traceoff
    986       $at_times_p && times >$at_times_file
    987     ) 5>&1 2>&1 | eval $at_tee_pipe
    988     at_status=`cat $at_status_file`
    989     ;;
    990 
    991   2 ) # 2. input.at:46: Invalid @n
    992     at_setup_line='input.at:46'
    993     at_desc='Invalid @n'
    994     $at_quiet $ECHO_N "  2: Invalid @n                                   $ECHO_C"
    995     at_xfail=no
    996     (
    997       echo "2. input.at:46: testing ..."
    998       $at_traceon
    999 
   1000 
   1001 cat >input.y <<'_ATEOF'
   1002 %%
   1003 exp: { @$ = @1 ; };
   1004 _ATEOF
   1005 
   1006 
   1007 $at_traceoff
   1008 echo "input.at:55: bison input.y"
   1009 echo input.at:55 >$at_check_line_file
   1010 ( $at_traceon; bison input.y ) >$at_stdout 2>$at_stder1
   1011 at_status=$?
   1012 grep '^ *+' $at_stder1 >&2
   1013 grep -v '^ *+' $at_stder1 >$at_stderr
   1014 at_failed=false
   1015 echo >>$at_stderr; echo "input.y:2.13-14: integer out of range: \`@1'
   1016 " | $at_diff - $at_stderr || at_failed=:
   1017 $at_diff $at_devnull $at_stdout || at_failed=:
   1018 case $at_status in
   1019    77) echo 77 > $at_status_file
   1020             exit 77;;
   1021    1) ;;
   1022    *) echo "input.at:55: exit code was $at_status, expected 1"
   1023       at_failed=:;;
   1024 esac
   1025 if $at_failed; then
   1026 
   1027   echo 1 > $at_status_file
   1028   exit 1
   1029 fi
   1030 
   1031 $at_traceon
   1032 
   1033 
   1034       $at_traceoff
   1035       $at_times_p && times >$at_times_file
   1036     ) 5>&1 2>&1 | eval $at_tee_pipe
   1037     at_status=`cat $at_status_file`
   1038     ;;
   1039 
   1040   3 ) # 3. input.at:64: Type Clashes
   1041     at_setup_line='input.at:64'
   1042     at_desc='Type Clashes'
   1043     $at_quiet $ECHO_N "  3: Type Clashes                                 $ECHO_C"
   1044     at_xfail=no
   1045     (
   1046       echo "3. input.at:64: testing ..."
   1047       $at_traceon
   1048 
   1049 
   1050 cat >input.y <<'_ATEOF'
   1051 %token foo
   1052 %type <bar> exp
   1053 %%
   1054 exp: foo {} foo
   1055    | foo
   1056    | /* Empty. */
   1057    ;
   1058 _ATEOF
   1059 
   1060 
   1061 $at_traceoff
   1062 echo "input.at:80: bison input.y"
   1063 echo input.at:80 >$at_check_line_file
   1064 ( $at_traceon; bison input.y ) >$at_stdout 2>$at_stder1
   1065 at_status=$?
   1066 grep '^ *+' $at_stder1 >&2
   1067 grep -v '^ *+' $at_stder1 >$at_stderr
   1068 at_failed=false
   1069 echo >>$at_stderr; echo "input.y:4.6-15: warning: type clash on default action: <bar> != <>
   1070 input.y:5.6-8: warning: type clash on default action: <bar> != <>
   1071 input.y:6.5: warning: empty rule for typed nonterminal, and no action
   1072 " | $at_diff - $at_stderr || at_failed=:
   1073 $at_diff $at_devnull $at_stdout || at_failed=:
   1074 case $at_status in
   1075    77) echo 77 > $at_status_file
   1076             exit 77;;
   1077    0) ;;
   1078    *) echo "input.at:80: exit code was $at_status, expected 0"
   1079       at_failed=:;;
   1080 esac
   1081 if $at_failed; then
   1082 
   1083   echo 1 > $at_status_file
   1084   exit 1
   1085 fi
   1086 
   1087 $at_traceon
   1088 
   1089 
   1090       $at_traceoff
   1091       $at_times_p && times >$at_times_file
   1092     ) 5>&1 2>&1 | eval $at_tee_pipe
   1093     at_status=`cat $at_status_file`
   1094     ;;
   1095 
   1096   4 ) # 4. input.at:89: Unused values
   1097     at_setup_line='input.at:89'
   1098     at_desc='Unused values'
   1099     $at_quiet $ECHO_N "  4: Unused values                                $ECHO_C"
   1100     at_xfail=no
   1101     (
   1102       echo "4. input.at:89: testing ..."
   1103       $at_traceon
   1104 
   1105 
   1106 cat >input.y <<'_ATEOF'
   1107 %token <integer> INT
   1108 %type <integer> a b c d e f g h i j k l
   1109 %destructor { destroy ($$); } INT a b c d e f g h i j k l
   1110 %%
   1111 start:
   1112   'a' a { $2 } | 'b' b { $2 } | 'c' c { $2 } | 'd' d { $2 } | 'e' e { $2 }
   1113 | 'f' f { $2 } | 'g' g { $2 } | 'h' h { $2 } | 'i' i { $2 } | 'j' j { $2 }
   1114 | 'k' k { $2 } | 'l' l { $2 }
   1115 ;
   1116 
   1117 a: INT | INT { } INT { } INT { };
   1118 b: INT | /* empty */;
   1119 c: INT | INT { $1 } INT { } INT { };
   1120 d: INT | INT { } INT { $1 } INT { };
   1121 e: INT | INT { } INT {  } INT { $1 };
   1122 f: INT | INT { } INT {  } INT { $$ = $1 + $3 + $5; };
   1123 g: INT | INT { $$ } INT { $$ } INT { };
   1124 h: INT | INT { $$ } INT { $$ = $2 } INT { };
   1125 i: INT | INT INT { } { $$ = $1 + $2; };
   1126 j: INT | INT INT { $<integer>$ = 1; } { $$ = $1 + $2; };
   1127 k: INT | INT INT { $$; } { $$ = $3; } { };
   1128 l: INT | INT { $$ = $1; } INT { $$ = $2 + $3; } INT { $$ = $4 + $5; };
   1129 
   1130 _ATEOF
   1131 
   1132 
   1133 $at_traceoff
   1134 echo "input.at:148: bison input.y"
   1135 echo input.at:148 >$at_check_line_file
   1136 ( $at_traceon; bison input.y ) >$at_stdout 2>$at_stder1
   1137 at_status=$?
   1138 grep '^ *+' $at_stder1 >&2
   1139 grep -v '^ *+' $at_stder1 >$at_stderr
   1140 at_failed=false
   1141 echo >>$at_stderr; echo "input.y:11.10-32: warning: unset value: \$\$
   1142 input.y:11.10-32: warning: unused value: \$1
   1143 input.y:11.10-32: warning: unused value: \$3
   1144 input.y:11.10-32: warning: unused value: \$5
   1145 input.y:12.9: warning: empty rule for typed nonterminal, and no action
   1146 input.y:13.10-35: warning: unset value: \$\$
   1147 input.y:13.10-35: warning: unused value: \$3
   1148 input.y:13.10-35: warning: unused value: \$5
   1149 input.y:14.10-35: warning: unset value: \$\$
   1150 input.y:14.10-35: warning: unused value: \$3
   1151 input.y:14.10-35: warning: unused value: \$5
   1152 input.y:15.10-36: warning: unset value: \$\$
   1153 input.y:15.10-36: warning: unused value: \$3
   1154 input.y:15.10-36: warning: unused value: \$5
   1155 input.y:17.10-38: warning: unset value: \$\$
   1156 input.y:17.10-38: warning: unused value: \$1
   1157 input.y:17.10-38: warning: unused value: \$2
   1158 input.y:17.10-38: warning: unused value: \$3
   1159 input.y:17.10-38: warning: unused value: \$4
   1160 input.y:17.10-38: warning: unused value: \$5
   1161 input.y:18.10-43: warning: unset value: \$\$
   1162 input.y:18.10-43: warning: unused value: \$1
   1163 input.y:18.10-43: warning: unused value: \$3
   1164 input.y:18.10-43: warning: unused value: \$4
   1165 input.y:18.10-43: warning: unused value: \$5
   1166 input.y:20.10-55: warning: unused value: \$3
   1167 input.y:21.10-41: warning: unset value: \$\$
   1168 input.y:21.10-41: warning: unused value: \$1
   1169 input.y:21.10-41: warning: unused value: \$2
   1170 input.y:21.10-41: warning: unused value: \$4
   1171 " | $at_diff - $at_stderr || at_failed=:
   1172 $at_diff $at_devnull $at_stdout || at_failed=:
   1173 case $at_status in
   1174    77) echo 77 > $at_status_file
   1175             exit 77;;
   1176    0) ;;
   1177    *) echo "input.at:148: exit code was $at_status, expected 0"
   1178       at_failed=:;;
   1179 esac
   1180 if $at_failed; then
   1181 
   1182   echo 1 > $at_status_file
   1183   exit 1
   1184 fi
   1185 
   1186 $at_traceon
   1187 
   1188 
   1189       $at_traceoff
   1190       $at_times_p && times >$at_times_file
   1191     ) 5>&1 2>&1 | eval $at_tee_pipe
   1192     at_status=`cat $at_status_file`
   1193     ;;
   1194 
   1195   5 ) # 5. input.at:157: Incompatible Aliases
   1196     at_setup_line='input.at:157'
   1197     at_desc='Incompatible Aliases'
   1198     $at_quiet $ECHO_N "  5: Incompatible Aliases                         $ECHO_C"
   1199     at_xfail=no
   1200     (
   1201       echo "5. input.at:157: testing ..."
   1202       $at_traceon
   1203 
   1204 
   1205 cat >input.y <<'_ATEOF'
   1206 %token foo "foo"
   1207 
   1208 %type <bar>       foo
   1209 %printer {bar}    foo
   1210 %destructor {bar} foo
   1211 %left             foo
   1212 
   1213 %type <baz>       "foo"
   1214 %printer {baz}    "foo"
   1215 %destructor {baz} "foo"
   1216 %left             "foo"
   1217 
   1218 %%
   1219 exp: foo;
   1220 _ATEOF
   1221 
   1222 
   1223 $at_traceoff
   1224 echo "input.at:185: bison input.y"
   1225 echo input.at:185 >$at_check_line_file
   1226 ( $at_traceon; bison input.y ) >$at_stdout 2>$at_stder1
   1227 at_status=$?
   1228 grep '^ *+' $at_stder1 >&2
   1229 grep -v '^ *+' $at_stder1 >$at_stderr
   1230 at_failed=false
   1231 echo >>$at_stderr; echo "input.y:8.7-11: %type redeclaration for foo
   1232 input.y:3.7-11: first declaration
   1233 input.y:10.13-17: %destructor redeclaration for foo
   1234 input.y:5.13-17: first declaration
   1235 input.y:9.10-14: %printer redeclaration for foo
   1236 input.y:10.13-17: first declaration
   1237 input.y:11.1-5: %left redeclaration for foo
   1238 input.y:6.1-5: first declaration
   1239 " | $at_diff - $at_stderr || at_failed=:
   1240 $at_diff $at_devnull $at_stdout || at_failed=:
   1241 case $at_status in
   1242    77) echo 77 > $at_status_file
   1243             exit 77;;
   1244    1) ;;
   1245    *) echo "input.at:185: exit code was $at_status, expected 1"
   1246       at_failed=:;;
   1247 esac
   1248 if $at_failed; then
   1249 
   1250   echo 1 > $at_status_file
   1251   exit 1
   1252 fi
   1253 
   1254 $at_traceon
   1255 
   1256 
   1257       $at_traceoff
   1258       $at_times_p && times >$at_times_file
   1259     ) 5>&1 2>&1 | eval $at_tee_pipe
   1260     at_status=`cat $at_status_file`
   1261     ;;
   1262 
   1263   6 ) # 6. input.at:198: Torturing the Scanner
   1264     at_setup_line='input.at:198'
   1265     at_desc='Torturing the Scanner'
   1266     $at_quiet $ECHO_N "  6: Torturing the Scanner                        $ECHO_C"
   1267     at_xfail=no
   1268     (
   1269       echo "6. input.at:198: testing ..."
   1270       $at_traceon
   1271 
   1272 
   1273 
   1274 cat >input.y <<'_ATEOF'
   1275 _ATEOF
   1276 
   1277 $at_traceoff
   1278 echo "input.at:204: bison input.y"
   1279 echo input.at:204 >$at_check_line_file
   1280 ( $at_traceon; bison input.y ) >$at_stdout 2>$at_stder1
   1281 at_status=$?
   1282 grep '^ *+' $at_stder1 >&2
   1283 grep -v '^ *+' $at_stder1 >$at_stderr
   1284 at_failed=false
   1285 echo >>$at_stderr; echo "input.y:1.1: syntax error, unexpected end of file
   1286 " | $at_diff - $at_stderr || at_failed=:
   1287 $at_diff $at_devnull $at_stdout || at_failed=:
   1288 case $at_status in
   1289    77) echo 77 > $at_status_file
   1290             exit 77;;
   1291    1) ;;
   1292    *) echo "input.at:204: exit code was $at_status, expected 1"
   1293       at_failed=:;;
   1294 esac
   1295 if $at_failed; then
   1296 
   1297   echo 1 > $at_status_file
   1298   exit 1
   1299 fi
   1300 
   1301 $at_traceon
   1302 
   1303 
   1304 
   1305 cat >input.y <<'_ATEOF'
   1306 {}
   1307 _ATEOF
   1308 
   1309 $at_traceoff
   1310 echo "input.at:212: bison input.y"
   1311 echo input.at:212 >$at_check_line_file
   1312 ( $at_traceon; bison input.y ) >$at_stdout 2>$at_stder1
   1313 at_status=$?
   1314 grep '^ *+' $at_stder1 >&2
   1315 grep -v '^ *+' $at_stder1 >$at_stderr
   1316 at_failed=false
   1317 echo >>$at_stderr; echo "input.y:1.1-2: syntax error, unexpected {...}
   1318 " | $at_diff - $at_stderr || at_failed=:
   1319 $at_diff $at_devnull $at_stdout || at_failed=:
   1320 case $at_status in
   1321    77) echo 77 > $at_status_file
   1322             exit 77;;
   1323    1) ;;
   1324    *) echo "input.at:212: exit code was $at_status, expected 1"
   1325       at_failed=:;;
   1326 esac
   1327 if $at_failed; then
   1328 
   1329   echo 1 > $at_status_file
   1330   exit 1
   1331 fi
   1332 
   1333 $at_traceon
   1334 
   1335 
   1336 
   1337 cat >input.y <<'_ATEOF'
   1338 %{
   1339 #ifdef HAVE_CONFIG_H
   1340 # include <config.h>
   1341   /* We don't need perfect functions for these tests. */
   1342 # undef malloc
   1343 # undef memcmp
   1344 # undef realloc
   1345 #endif
   1346 %}
   1347 
   1348 %{
   1349 /* This is seen in GCC: a %{ and %} in middle of a comment. */
   1350 const char *foo = "So %{ and %} can be here too.";
   1351 
   1352 #if 0
   1353 /* These examples test Bison while not stressing C compilers too much.
   1354    Many C compilers mishandle backslash-newlines, so this part of the
   1355    test is inside "#if 0".  The comment and string are written so that
   1356    the "#endif" will be seen regardless of the C compiler bugs that we
   1357    know about, namely:
   1358 
   1359      HP C (as of late 2002) mishandles *\[newline]\[newline]/ within a
   1360      comment.
   1361 
   1362      The Apple Darwin compiler (as of late 2002) mishandles
   1363      \\[newline]' within a character constant.
   1364 
   1365    */
   1366 
   1367 /\
   1368 * A comment with backslash-newlines in it. %} *\
   1369 \
   1370 /
   1371 /* { Close the above comment, if the C compiler mishandled it.  */
   1372 
   1373 char str[] = "\\
   1374 " A string with backslash-newlines in it %{ %} \\
   1375 \
   1376 "";
   1377 
   1378 char apostrophe = '\'';
   1379 #endif
   1380 
   1381 #include <stdio.h>
   1382 %}
   1383 /* %{ and %} can be here too. */
   1384 
   1385 %{
   1386 /* Exercise pre-prologue dependency to %union.  */
   1387 typedef int value;
   1388 %}
   1389 
   1390 /* Exercise M4 quoting: ']]', 0.  */
   1391 
   1392 /* Also exercise %union. */
   1393 %union
   1394 {
   1395   value ival; /* A comment to exercise an old bug. */
   1396 };
   1397 
   1398 
   1399 /* Exercise post-prologue dependency to %union.  */
   1400 %{
   1401 static YYSTYPE value_as_yystype (value val);
   1402 
   1403 /* Exercise quotes in declarations.  */
   1404 char quote[] = "]],";
   1405 %}
   1406 
   1407 %{
   1408 static void yyerror (const char *s);
   1409 static int yylex (void);
   1410 %}
   1411 
   1412 %type <ival> '['
   1413 
   1414 /* Exercise quotes in strings.  */
   1415 %token FAKE "fake [] \a\b\f\n\r\t\v\"\'\?\\\u005B\U0000005c ??!??'??(??)??-??/??<??=??> \x1\1"
   1416 
   1417 %%
   1418 /* Exercise M4 quoting: ']]', [, 1.  */
   1419 exp: '[' '\1' two '$' '@' '{' oline output.or.oline.opt
   1420   {
   1421     /* Exercise quotes in braces.  */
   1422     char tmp[] = "[%c],\n";
   1423     printf (tmp, $1);
   1424   }
   1425 ;
   1426 
   1427 two: '\x000000000000000000000000000000000000000000000000000000000000000000002';
   1428 oline: '@' 'o' 'l' 'i' 'n' 'e' '@' '_' '_' 'o' 'l' 'i' 'n' 'e' '_' '_';
   1429 output.or.oline.opt: ;|oline;;|output;;;
   1430 output: '#' 'o' 'u' 't' 'p' 'u' 't' ' ';
   1431 %%
   1432 /* Exercise M4 quoting: ']]', [, 2.  */
   1433 
   1434 static YYSTYPE
   1435 value_as_yystype (value val)
   1436 {
   1437   YYSTYPE res;
   1438   res.ival = val;
   1439   return res;
   1440 }
   1441 
   1442 static int
   1443 yylex (void)
   1444 {
   1445   static const char *input = "[\1\2$@{@oline@__oline__\
   1446 #output "; /* "
   1447   */
   1448   yylval = value_as_yystype (*input);
   1449   return *input++;
   1450 }
   1451 
   1452 static void
   1453 yyerror (const char *msg)
   1454 {
   1455   fprintf (stderr, "%s\n", msg);
   1456 }
   1457 _ATEOF
   1458 
   1459 
   1460 
   1461 # Pacify Emacs'font-lock-mode: "
   1462 
   1463 cat >main.c <<'_ATEOF'
   1464 typedef int value;
   1465 #include "input.h"
   1466 
   1467 int yyparse (void);
   1468 
   1469 int
   1470 main (void)
   1471 {
   1472   return yyparse ();
   1473 }
   1474 _ATEOF
   1475 
   1476 
   1477 $at_traceoff
   1478 echo "input.at:342: bison -d -v -o input.c input.y"
   1479 echo input.at:342 >$at_check_line_file
   1480 ( $at_traceon; bison -d -v -o input.c input.y ) >$at_stdout 2>$at_stder1
   1481 at_status=$?
   1482 grep '^ *+' $at_stder1 >&2
   1483 grep -v '^ *+' $at_stder1 >$at_stderr
   1484 at_failed=false
   1485 $at_diff $at_devnull $at_stderr || at_failed=:
   1486 $at_diff $at_devnull $at_stdout || at_failed=:
   1487 case $at_status in
   1488    77) echo 77 > $at_status_file
   1489             exit 77;;
   1490    0) ;;
   1491    *) echo "input.at:342: exit code was $at_status, expected 0"
   1492       at_failed=:;;
   1493 esac
   1494 if $at_failed; then
   1495 
   1496   echo 1 > $at_status_file
   1497   exit 1
   1498 fi
   1499 
   1500 $at_traceon
   1501 
   1502 $at_traceoff
   1503 echo "input.at:343: \$CC \$CFLAGS \$CPPFLAGS -o input.o -c input.c"
   1504 echo input.at:343 >$at_check_line_file
   1505 ( $at_traceon; $CC $CFLAGS $CPPFLAGS -o input.o -c input.c ) >$at_stdout 2>$at_stder1
   1506 at_status=$?
   1507 grep '^ *+' $at_stder1 >&2
   1508 grep -v '^ *+' $at_stder1 >$at_stderr
   1509 at_failed=false
   1510 echo stderr:; cat $at_stderr
   1511 echo stdout:; cat $at_stdout
   1512 case $at_status in
   1513    77) echo 77 > $at_status_file
   1514             exit 77;;
   1515    0) ;;
   1516    *) echo "input.at:343: exit code was $at_status, expected 0"
   1517       at_failed=:;;
   1518 esac
   1519 if $at_failed; then
   1520 
   1521   echo 1 > $at_status_file
   1522   exit 1
   1523 fi
   1524 
   1525 $at_traceon
   1526 
   1527 $at_traceoff
   1528 echo "input.at:344: \$CC \$CFLAGS \$CPPFLAGS -o main.o -c main.c"
   1529 echo input.at:344 >$at_check_line_file
   1530 ( $at_traceon; $CC $CFLAGS $CPPFLAGS -o main.o -c main.c ) >$at_stdout 2>$at_stder1
   1531 at_status=$?
   1532 grep '^ *+' $at_stder1 >&2
   1533 grep -v '^ *+' $at_stder1 >$at_stderr
   1534 at_failed=false
   1535 echo stderr:; cat $at_stderr
   1536 echo stdout:; cat $at_stdout
   1537 case $at_status in
   1538    77) echo 77 > $at_status_file
   1539             exit 77;;
   1540    0) ;;
   1541    *) echo "input.at:344: exit code was $at_status, expected 0"
   1542       at_failed=:;;
   1543 esac
   1544 if $at_failed; then
   1545 
   1546   echo 1 > $at_status_file
   1547   exit 1
   1548 fi
   1549 
   1550 $at_traceon
   1551 
   1552 $at_traceoff
   1553 echo "input.at:345: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.o main.o \$LIBS"
   1554 echo input.at:345 >$at_check_line_file
   1555 ( $at_traceon; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.o main.o $LIBS ) >$at_stdout 2>$at_stder1
   1556 at_status=$?
   1557 grep '^ *+' $at_stder1 >&2
   1558 grep -v '^ *+' $at_stder1 >$at_stderr
   1559 at_failed=false
   1560 echo stderr:; cat $at_stderr
   1561 echo stdout:; cat $at_stdout
   1562 case $at_status in
   1563    77) echo 77 > $at_status_file
   1564             exit 77;;
   1565    0) ;;
   1566    *) echo "input.at:345: exit code was $at_status, expected 0"
   1567       at_failed=:;;
   1568 esac
   1569 if $at_failed; then
   1570 
   1571   echo 1 > $at_status_file
   1572   exit 1
   1573 fi
   1574 
   1575 $at_traceon
   1576 
   1577 $at_traceoff
   1578 echo "input.at:348: \$PREPARSER ./input"
   1579 echo input.at:348 >$at_check_line_file
   1580 ( $at_traceon; $PREPARSER ./input ) >$at_stdout 2>$at_stder1
   1581 at_status=$?
   1582 grep '^ *+' $at_stder1 >&2
   1583 grep -v '^ *+' $at_stder1 >$at_stderr
   1584 at_failed=false
   1585 $at_diff $at_devnull $at_stderr || at_failed=:
   1586 echo >>$at_stdout; echo "[[],
   1587 " | $at_diff - $at_stdout || at_failed=:
   1588 case $at_status in
   1589    77) echo 77 > $at_status_file
   1590             exit 77;;
   1591    0) ;;
   1592    *) echo "input.at:348: exit code was $at_status, expected 0"
   1593       at_failed=:;;
   1594 esac
   1595 if $at_failed; then
   1596 
   1597   echo 1 > $at_status_file
   1598   exit 1
   1599 fi
   1600 
   1601 $at_traceon
   1602 
   1603 
   1604       $at_traceoff
   1605       $at_times_p && times >$at_times_file
   1606     ) 5>&1 2>&1 | eval $at_tee_pipe
   1607     at_status=`cat $at_status_file`
   1608     ;;
   1609 
   1610   7 ) # 7. input.at:357: Typed symbol aliases
   1611     at_setup_line='input.at:357'
   1612     at_desc='Typed symbol aliases'
   1613     $at_quiet $ECHO_N "  7: Typed symbol aliases                         $ECHO_C"
   1614     at_xfail=no
   1615     (
   1616       echo "7. input.at:357: testing ..."
   1617       $at_traceon
   1618 
   1619 
   1620 # Bison 2.0 broke typed symbol aliases - ensure they work.
   1621 
   1622 cat >input.y <<'_ATEOF'
   1623 %{
   1624 #ifdef HAVE_CONFIG_H
   1625 # include <config.h>
   1626   /* We don't need perfect functions for these tests. */
   1627 # undef malloc
   1628 # undef memcmp
   1629 # undef realloc
   1630 #endif
   1631 %}
   1632 
   1633 %union
   1634 {
   1635   int val;
   1636 };
   1637 %token <val> MY_TOKEN "MY TOKEN"
   1638 %type <val> exp
   1639 %%
   1640 exp: "MY TOKEN";
   1641 %%
   1642 _ATEOF
   1643 
   1644 
   1645 
   1646 $at_traceoff
   1647 echo "input.at:373: bison -o input.c input.y"
   1648 echo input.at:373 >$at_check_line_file
   1649 ( $at_traceon; bison -o input.c input.y ) >$at_stdout 2>$at_stder1
   1650 at_status=$?
   1651 grep '^ *+' $at_stder1 >&2
   1652 grep -v '^ *+' $at_stder1 >$at_stderr
   1653 at_failed=false
   1654 $at_diff $at_devnull $at_stderr || at_failed=:
   1655 $at_diff $at_devnull $at_stdout || at_failed=:
   1656 case $at_status in
   1657    77) echo 77 > $at_status_file
   1658             exit 77;;
   1659    0) ;;
   1660    *) echo "input.at:373: exit code was $at_status, expected 0"
   1661       at_failed=:;;
   1662 esac
   1663 if $at_failed; then
   1664 
   1665   echo 1 > $at_status_file
   1666   exit 1
   1667 fi
   1668 
   1669 $at_traceon
   1670 
   1671 
   1672       $at_traceoff
   1673       $at_times_p && times >$at_times_file
   1674     ) 5>&1 2>&1 | eval $at_tee_pipe
   1675     at_status=`cat $at_status_file`
   1676     ;;
   1677 
   1678   8 ) # 8. input.at:393: Require 1.0
   1679     at_setup_line='input.at:393'
   1680     at_desc='Require 1.0'
   1681     $at_quiet $ECHO_N "  8: Require 1.0                                  $ECHO_C"
   1682     at_xfail=no
   1683     (
   1684       echo "8. input.at:393: testing ..."
   1685       $at_traceon
   1686 
   1687 cat >input.y <<'_ATEOF'
   1688 %{
   1689 #ifdef HAVE_CONFIG_H
   1690 # include <config.h>
   1691   /* We don't need perfect functions for these tests. */
   1692 # undef malloc
   1693 # undef memcmp
   1694 # undef realloc
   1695 #endif
   1696 %}
   1697 
   1698 %require "1.0";
   1699 %%
   1700 empty_file:;
   1701 _ATEOF
   1702 
   1703 
   1704 $at_traceoff
   1705 echo "input.at:393: bison -o input.c input.y"
   1706 echo input.at:393 >$at_check_line_file
   1707 ( $at_traceon; bison -o input.c input.y ) >$at_stdout 2>$at_stder1
   1708 at_status=$?
   1709 grep '^ *+' $at_stder1 >&2
   1710 grep -v '^ *+' $at_stder1 >$at_stderr
   1711 at_failed=false
   1712 echo stderr:; cat $at_stderr
   1713 $at_diff $at_devnull $at_stdout || at_failed=:
   1714 case $at_status in
   1715    77) echo 77 > $at_status_file
   1716             exit 77;;
   1717    0) ;;
   1718    *) echo "input.at:393: exit code was $at_status, expected 0"
   1719       at_failed=:;;
   1720 esac
   1721 if $at_failed; then
   1722 
   1723   echo 1 > $at_status_file
   1724   exit 1
   1725 fi
   1726 
   1727 $at_traceon
   1728 
   1729       $at_traceoff
   1730       $at_times_p && times >$at_times_file
   1731     ) 5>&1 2>&1 | eval $at_tee_pipe
   1732     at_status=`cat $at_status_file`
   1733     ;;
   1734 
   1735   9 ) # 9. input.at:394: Require 2.3
   1736     at_setup_line='input.at:394'
   1737     at_desc='Require 2.3'
   1738     $at_quiet $ECHO_N "  9: Require 2.3                                  $ECHO_C"
   1739     at_xfail=no
   1740     (
   1741       echo "9. input.at:394: testing ..."
   1742       $at_traceon
   1743 
   1744 cat >input.y <<'_ATEOF'
   1745 %{
   1746 #ifdef HAVE_CONFIG_H
   1747 # include <config.h>
   1748   /* We don't need perfect functions for these tests. */
   1749 # undef malloc
   1750 # undef memcmp
   1751 # undef realloc
   1752 #endif
   1753 %}
   1754 
   1755 %require "2.3";
   1756 %%
   1757 empty_file:;
   1758 _ATEOF
   1759 
   1760 
   1761 $at_traceoff
   1762 echo "input.at:394: bison -o input.c input.y"
   1763 echo input.at:394 >$at_check_line_file
   1764 ( $at_traceon; bison -o input.c input.y ) >$at_stdout 2>$at_stder1
   1765 at_status=$?
   1766 grep '^ *+' $at_stder1 >&2
   1767 grep -v '^ *+' $at_stder1 >$at_stderr
   1768 at_failed=false
   1769 echo stderr:; cat $at_stderr
   1770 $at_diff $at_devnull $at_stdout || at_failed=:
   1771 case $at_status in
   1772    77) echo 77 > $at_status_file
   1773             exit 77;;
   1774    0) ;;
   1775    *) echo "input.at:394: exit code was $at_status, expected 0"
   1776       at_failed=:;;
   1777 esac
   1778 if $at_failed; then
   1779 
   1780   echo 1 > $at_status_file
   1781   exit 1
   1782 fi
   1783 
   1784 $at_traceon
   1785 
   1786       $at_traceoff
   1787       $at_times_p && times >$at_times_file
   1788     ) 5>&1 2>&1 | eval $at_tee_pipe
   1789     at_status=`cat $at_status_file`
   1790     ;;
   1791 
   1792   10 ) # 10. input.at:396: Require 100.0
   1793     at_setup_line='input.at:396'
   1794     at_desc='Require 100.0'
   1795     $at_quiet $ECHO_N " 10: Require 100.0                                $ECHO_C"
   1796     at_xfail=no
   1797     (
   1798       echo "10. input.at:396: testing ..."
   1799       $at_traceon
   1800 
   1801 cat >input.y <<'_ATEOF'
   1802 %{
   1803 #ifdef HAVE_CONFIG_H
   1804 # include <config.h>
   1805   /* We don't need perfect functions for these tests. */
   1806 # undef malloc
   1807 # undef memcmp
   1808 # undef realloc
   1809 #endif
   1810 %}
   1811 
   1812 %require "100.0";
   1813 %%
   1814 empty_file:;
   1815 _ATEOF
   1816 
   1817 
   1818 $at_traceoff
   1819 echo "input.at:396: bison -o input.c input.y"
   1820 echo input.at:396 >$at_check_line_file
   1821 ( $at_traceon; bison -o input.c input.y ) >$at_stdout 2>$at_stder1
   1822 at_status=$?
   1823 grep '^ *+' $at_stder1 >&2
   1824 grep -v '^ *+' $at_stder1 >$at_stderr
   1825 at_failed=false
   1826 echo stderr:; cat $at_stderr
   1827 $at_diff $at_devnull $at_stdout || at_failed=:
   1828 case $at_status in
   1829    77) echo 77 > $at_status_file
   1830             exit 77;;
   1831    63) ;;
   1832    *) echo "input.at:396: exit code was $at_status, expected 63"
   1833       at_failed=:;;
   1834 esac
   1835 if $at_failed; then
   1836 
   1837   echo 1 > $at_status_file
   1838   exit 1
   1839 fi
   1840 
   1841 $at_traceon
   1842 
   1843       $at_traceoff
   1844       $at_times_p && times >$at_times_file
   1845     ) 5>&1 2>&1 | eval $at_tee_pipe
   1846     at_status=`cat $at_status_file`
   1847     ;;
   1848 
   1849 
   1850   banner-2 ) # Banner 2. output.at:19
   1851     cat <<\_ATEOF
   1852 
   1853 Output file names.
   1854 
   1855 _ATEOF
   1856     ;;
   1857 
   1858   11 ) # 11. output.at:43: Output files:  -dv
   1859     at_setup_line='output.at:43'
   1860     at_desc='Output files:  -dv '
   1861     $at_quiet $ECHO_N " 11: Output files:  -dv                           $ECHO_C"
   1862     at_xfail=no
   1863     (
   1864       echo "11. output.at:43: testing ..."
   1865       $at_traceon
   1866 
   1867 case "foo.y" in
   1868   */*) mkdir `echo "foo.y" | sed 's,/.*,,'`;;
   1869 esac
   1870 cat >foo.y <<'_ATEOF'
   1871 
   1872 %%
   1873 foo: {};
   1874 _ATEOF
   1875 
   1876 
   1877 $at_traceoff
   1878 echo "output.at:43: bison -dv foo.y "
   1879 echo output.at:43 >$at_check_line_file
   1880 ( $at_traceon; bison -dv foo.y  ) >$at_stdout 2>$at_stder1
   1881 at_status=$?
   1882 grep '^ *+' $at_stder1 >&2
   1883 grep -v '^ *+' $at_stder1 >$at_stderr
   1884 at_failed=false
   1885 $at_diff $at_devnull $at_stderr || at_failed=:
   1886 $at_diff $at_devnull $at_stdout || at_failed=:
   1887 case $at_status in
   1888    77) echo 77 > $at_status_file
   1889             exit 77;;
   1890    0) ;;
   1891    *) echo "output.at:43: exit code was $at_status, expected 0"
   1892       at_failed=:;;
   1893 esac
   1894 if $at_failed; then
   1895 
   1896   echo 1 > $at_status_file
   1897   exit 1
   1898 fi
   1899 
   1900 $at_traceon
   1901 
   1902 $at_traceoff
   1903 echo "output.at:43: ls foo.output foo.tab.c foo.tab.h"
   1904 echo output.at:43 >$at_check_line_file
   1905 ( $at_traceon; ls foo.output foo.tab.c foo.tab.h ) >$at_stdout 2>$at_stder1
   1906 at_status=$?
   1907 grep '^ *+' $at_stder1 >&2
   1908 grep -v '^ *+' $at_stder1 >$at_stderr
   1909 at_failed=false
   1910 $at_diff $at_devnull $at_stderr || at_failed=:
   1911 echo stdout:; cat $at_stdout
   1912 case $at_status in
   1913    77) echo 77 > $at_status_file
   1914             exit 77;;
   1915    0) ;;
   1916    *) echo "output.at:43: exit code was $at_status, expected 0"
   1917       at_failed=:;;
   1918 esac
   1919 if $at_failed; then
   1920 
   1921   echo 1 > $at_status_file
   1922   exit 1
   1923 fi
   1924 
   1925 $at_traceon
   1926 
   1927 
   1928       $at_traceoff
   1929       $at_times_p && times >$at_times_file
   1930     ) 5>&1 2>&1 | eval $at_tee_pipe
   1931     at_status=`cat $at_status_file`
   1932     ;;
   1933 
   1934   12 ) # 12. output.at:46: Output files:  -dv >&-
   1935     at_setup_line='output.at:46'
   1936     at_desc='Output files:  -dv >&-'
   1937     $at_quiet $ECHO_N " 12: Output files:  -dv >&-                       $ECHO_C"
   1938     at_xfail=no
   1939     (
   1940       echo "12. output.at:46: testing ..."
   1941       $at_traceon
   1942 
   1943 case "foo.y" in
   1944   */*) mkdir `echo "foo.y" | sed 's,/.*,,'`;;
   1945 esac
   1946 cat >foo.y <<'_ATEOF'
   1947 
   1948 %%
   1949 foo: {};
   1950 _ATEOF
   1951 
   1952 
   1953 $at_traceoff
   1954 echo "output.at:46: bison -dv foo.y >&-"
   1955 echo output.at:46 >$at_check_line_file
   1956 ( $at_traceon; bison -dv foo.y >&- ) >$at_stdout 2>$at_stder1
   1957 at_status=$?
   1958 grep '^ *+' $at_stder1 >&2
   1959 grep -v '^ *+' $at_stder1 >$at_stderr
   1960 at_failed=false
   1961 $at_diff $at_devnull $at_stderr || at_failed=:
   1962 $at_diff $at_devnull $at_stdout || at_failed=:
   1963 case $at_status in
   1964    77) echo 77 > $at_status_file
   1965             exit 77;;
   1966    0) ;;
   1967    *) echo "output.at:46: exit code was $at_status, expected 0"
   1968       at_failed=:;;
   1969 esac
   1970 if $at_failed; then
   1971 
   1972   echo 1 > $at_status_file
   1973   exit 1
   1974 fi
   1975 
   1976 $at_traceon
   1977 
   1978 $at_traceoff
   1979 echo "output.at:46: ls foo.output foo.tab.c foo.tab.h"
   1980 echo output.at:46 >$at_check_line_file
   1981 ( $at_traceon; ls foo.output foo.tab.c foo.tab.h ) >$at_stdout 2>$at_stder1
   1982 at_status=$?
   1983 grep '^ *+' $at_stder1 >&2
   1984 grep -v '^ *+' $at_stder1 >$at_stderr
   1985 at_failed=false
   1986 $at_diff $at_devnull $at_stderr || at_failed=:
   1987 echo stdout:; cat $at_stdout
   1988 case $at_status in
   1989    77) echo 77 > $at_status_file
   1990             exit 77;;
   1991    0) ;;
   1992    *) echo "output.at:46: exit code was $at_status, expected 0"
   1993       at_failed=:;;
   1994 esac
   1995 if $at_failed; then
   1996 
   1997   echo 1 > $at_status_file
   1998   exit 1
   1999 fi
   2000 
   2001 $at_traceon
   2002 
   2003 
   2004       $at_traceoff
   2005       $at_times_p && times >$at_times_file
   2006     ) 5>&1 2>&1 | eval $at_tee_pipe
   2007     at_status=`cat $at_status_file`
   2008     ;;
   2009 
   2010   13 ) # 13. output.at:48: Output files:  -dv -o foo.c
   2011     at_setup_line='output.at:48'
   2012     at_desc='Output files:  -dv -o foo.c '
   2013     $at_quiet $ECHO_N " 13: Output files:  -dv -o foo.c                  $ECHO_C"
   2014     at_xfail=no
   2015     (
   2016       echo "13. output.at:48: testing ..."
   2017       $at_traceon
   2018 
   2019 case "foo.y" in
   2020   */*) mkdir `echo "foo.y" | sed 's,/.*,,'`;;
   2021 esac
   2022 cat >foo.y <<'_ATEOF'
   2023 
   2024 %%
   2025 foo: {};
   2026 _ATEOF
   2027 
   2028 
   2029 $at_traceoff
   2030 echo "output.at:48: bison -dv -o foo.c foo.y "
   2031 echo output.at:48 >$at_check_line_file
   2032 ( $at_traceon; bison -dv -o foo.c foo.y  ) >$at_stdout 2>$at_stder1
   2033 at_status=$?
   2034 grep '^ *+' $at_stder1 >&2
   2035 grep -v '^ *+' $at_stder1 >$at_stderr
   2036 at_failed=false
   2037 $at_diff $at_devnull $at_stderr || at_failed=:
   2038 $at_diff $at_devnull $at_stdout || at_failed=:
   2039 case $at_status in
   2040    77) echo 77 > $at_status_file
   2041             exit 77;;
   2042    0) ;;
   2043    *) echo "output.at:48: exit code was $at_status, expected 0"
   2044       at_failed=:;;
   2045 esac
   2046 if $at_failed; then
   2047 
   2048   echo 1 > $at_status_file
   2049   exit 1
   2050 fi
   2051 
   2052 $at_traceon
   2053 
   2054 $at_traceoff
   2055 echo "output.at:48: ls foo.c foo.h foo.output"
   2056 echo output.at:48 >$at_check_line_file
   2057 ( $at_traceon; ls foo.c foo.h foo.output ) >$at_stdout 2>$at_stder1
   2058 at_status=$?
   2059 grep '^ *+' $at_stder1 >&2
   2060 grep -v '^ *+' $at_stder1 >$at_stderr
   2061 at_failed=false
   2062 $at_diff $at_devnull $at_stderr || at_failed=:
   2063 echo stdout:; cat $at_stdout
   2064 case $at_status in
   2065    77) echo 77 > $at_status_file
   2066             exit 77;;
   2067    0) ;;
   2068    *) echo "output.at:48: exit code was $at_status, expected 0"
   2069       at_failed=:;;
   2070 esac
   2071 if $at_failed; then
   2072 
   2073   echo 1 > $at_status_file
   2074   exit 1
   2075 fi
   2076 
   2077 $at_traceon
   2078 
   2079 
   2080       $at_traceoff
   2081       $at_times_p && times >$at_times_file
   2082     ) 5>&1 2>&1 | eval $at_tee_pipe
   2083     at_status=`cat $at_status_file`
   2084     ;;
   2085 
   2086   14 ) # 14. output.at:50: Output files:  -dv -o foo.tab.c
   2087     at_setup_line='output.at:50'
   2088     at_desc='Output files:  -dv -o foo.tab.c '
   2089     $at_quiet $ECHO_N " 14: Output files:  -dv -o foo.tab.c              $ECHO_C"
   2090     at_xfail=no
   2091     (
   2092       echo "14. output.at:50: testing ..."
   2093       $at_traceon
   2094 
   2095 case "foo.y" in
   2096   */*) mkdir `echo "foo.y" | sed 's,/.*,,'`;;
   2097 esac
   2098 cat >foo.y <<'_ATEOF'
   2099 
   2100 %%
   2101 foo: {};
   2102 _ATEOF
   2103 
   2104 
   2105 $at_traceoff
   2106 echo "output.at:50: bison -dv -o foo.tab.c foo.y "
   2107 echo output.at:50 >$at_check_line_file
   2108 ( $at_traceon; bison -dv -o foo.tab.c foo.y  ) >$at_stdout 2>$at_stder1
   2109 at_status=$?
   2110 grep '^ *+' $at_stder1 >&2
   2111 grep -v '^ *+' $at_stder1 >$at_stderr
   2112 at_failed=false
   2113 $at_diff $at_devnull $at_stderr || at_failed=:
   2114 $at_diff $at_devnull $at_stdout || at_failed=:
   2115 case $at_status in
   2116    77) echo 77 > $at_status_file
   2117             exit 77;;
   2118    0) ;;
   2119    *) echo "output.at:50: exit code was $at_status, expected 0"
   2120       at_failed=:;;
   2121 esac
   2122 if $at_failed; then
   2123 
   2124   echo 1 > $at_status_file
   2125   exit 1
   2126 fi
   2127 
   2128 $at_traceon
   2129 
   2130 $at_traceoff
   2131 echo "output.at:50: ls foo.output foo.tab.c foo.tab.h"
   2132 echo output.at:50 >$at_check_line_file
   2133 ( $at_traceon; ls foo.output foo.tab.c foo.tab.h ) >$at_stdout 2>$at_stder1
   2134 at_status=$?
   2135 grep '^ *+' $at_stder1 >&2
   2136 grep -v '^ *+' $at_stder1 >$at_stderr
   2137 at_failed=false
   2138 $at_diff $at_devnull $at_stderr || at_failed=:
   2139 echo stdout:; cat $at_stdout
   2140 case $at_status in
   2141    77) echo 77 > $at_status_file
   2142             exit 77;;
   2143    0) ;;
   2144    *) echo "output.at:50: exit code was $at_status, expected 0"
   2145       at_failed=:;;
   2146 esac
   2147 if $at_failed; then
   2148 
   2149   echo 1 > $at_status_file
   2150   exit 1
   2151 fi
   2152 
   2153 $at_traceon
   2154 
   2155 
   2156       $at_traceoff
   2157       $at_times_p && times >$at_times_file
   2158     ) 5>&1 2>&1 | eval $at_tee_pipe
   2159     at_status=`cat $at_status_file`
   2160     ;;
   2161 
   2162   15 ) # 15. output.at:52: Output files:  -dv -y
   2163     at_setup_line='output.at:52'
   2164     at_desc='Output files:  -dv -y '
   2165     $at_quiet $ECHO_N " 15: Output files:  -dv -y                        $ECHO_C"
   2166     at_xfail=no
   2167     (
   2168       echo "15. output.at:52: testing ..."
   2169       $at_traceon
   2170 
   2171 case "foo.y" in
   2172   */*) mkdir `echo "foo.y" | sed 's,/.*,,'`;;
   2173 esac
   2174 cat >foo.y <<'_ATEOF'
   2175 
   2176 %%
   2177 foo: {};
   2178 _ATEOF
   2179 
   2180 
   2181 $at_traceoff
   2182 echo "output.at:52: bison -dv -y foo.y "
   2183 echo output.at:52 >$at_check_line_file
   2184 ( $at_traceon; bison -dv -y foo.y  ) >$at_stdout 2>$at_stder1
   2185 at_status=$?
   2186 grep '^ *+' $at_stder1 >&2
   2187 grep -v '^ *+' $at_stder1 >$at_stderr
   2188 at_failed=false
   2189 $at_diff $at_devnull $at_stderr || at_failed=:
   2190 $at_diff $at_devnull $at_stdout || at_failed=:
   2191 case $at_status in
   2192    77) echo 77 > $at_status_file
   2193             exit 77;;
   2194    0) ;;
   2195    *) echo "output.at:52: exit code was $at_status, expected 0"
   2196       at_failed=:;;
   2197 esac
   2198 if $at_failed; then
   2199 
   2200   echo 1 > $at_status_file
   2201   exit 1
   2202 fi
   2203 
   2204 $at_traceon
   2205 
   2206 $at_traceoff
   2207 echo "output.at:52: ls y.output y.tab.c y.tab.h"
   2208 echo output.at:52 >$at_check_line_file
   2209 ( $at_traceon; ls y.output y.tab.c y.tab.h ) >$at_stdout 2>$at_stder1
   2210 at_status=$?
   2211 grep '^ *+' $at_stder1 >&2
   2212 grep -v '^ *+' $at_stder1 >$at_stderr
   2213 at_failed=false
   2214 $at_diff $at_devnull $at_stderr || at_failed=:
   2215 echo stdout:; cat $at_stdout
   2216 case $at_status in
   2217    77) echo 77 > $at_status_file
   2218             exit 77;;
   2219    0) ;;
   2220    *) echo "output.at:52: exit code was $at_status, expected 0"
   2221       at_failed=:;;
   2222 esac
   2223 if $at_failed; then
   2224 
   2225   echo 1 > $at_status_file
   2226   exit 1
   2227 fi
   2228 
   2229 $at_traceon
   2230 
   2231 
   2232       $at_traceoff
   2233       $at_times_p && times >$at_times_file
   2234     ) 5>&1 2>&1 | eval $at_tee_pipe
   2235     at_status=`cat $at_status_file`
   2236     ;;
   2237 
   2238   16 ) # 16. output.at:54: Output files:  -dv -b bar
   2239     at_setup_line='output.at:54'
   2240     at_desc='Output files:  -dv -b bar '
   2241     $at_quiet $ECHO_N " 16: Output files:  -dv -b bar                    $ECHO_C"
   2242     at_xfail=no
   2243     (
   2244       echo "16. output.at:54: testing ..."
   2245       $at_traceon
   2246 
   2247 case "foo.y" in
   2248   */*) mkdir `echo "foo.y" | sed 's,/.*,,'`;;
   2249 esac
   2250 cat >foo.y <<'_ATEOF'
   2251 
   2252 %%
   2253 foo: {};
   2254 _ATEOF
   2255 
   2256 
   2257 $at_traceoff
   2258 echo "output.at:54: bison -dv -b bar foo.y "
   2259 echo output.at:54 >$at_check_line_file
   2260 ( $at_traceon; bison -dv -b bar foo.y  ) >$at_stdout 2>$at_stder1
   2261 at_status=$?
   2262 grep '^ *+' $at_stder1 >&2
   2263 grep -v '^ *+' $at_stder1 >$at_stderr
   2264 at_failed=false
   2265 $at_diff $at_devnull $at_stderr || at_failed=:
   2266 $at_diff $at_devnull $at_stdout || at_failed=:
   2267 case $at_status in
   2268    77) echo 77 > $at_status_file
   2269             exit 77;;
   2270    0) ;;
   2271    *) echo "output.at:54: exit code was $at_status, expected 0"
   2272       at_failed=:;;
   2273 esac
   2274 if $at_failed; then
   2275 
   2276   echo 1 > $at_status_file
   2277   exit 1
   2278 fi
   2279 
   2280 $at_traceon
   2281 
   2282 $at_traceoff
   2283 echo "output.at:54: ls bar.output bar.tab.c bar.tab.h"
   2284 echo output.at:54 >$at_check_line_file
   2285 ( $at_traceon; ls bar.output bar.tab.c bar.tab.h ) >$at_stdout 2>$at_stder1
   2286 at_status=$?
   2287 grep '^ *+' $at_stder1 >&2
   2288 grep -v '^ *+' $at_stder1 >$at_stderr
   2289 at_failed=false
   2290 $at_diff $at_devnull $at_stderr || at_failed=:
   2291 echo stdout:; cat $at_stdout
   2292 case $at_status in
   2293    77) echo 77 > $at_status_file
   2294             exit 77;;
   2295    0) ;;
   2296    *) echo "output.at:54: exit code was $at_status, expected 0"
   2297       at_failed=:;;
   2298 esac
   2299 if $at_failed; then
   2300 
   2301   echo 1 > $at_status_file
   2302   exit 1
   2303 fi
   2304 
   2305 $at_traceon
   2306 
   2307 
   2308       $at_traceoff
   2309       $at_times_p && times >$at_times_file
   2310     ) 5>&1 2>&1 | eval $at_tee_pipe
   2311     at_status=`cat $at_status_file`
   2312     ;;
   2313 
   2314   17 ) # 17. output.at:56: Output files:  -dv -g -o foo.c
   2315     at_setup_line='output.at:56'
   2316     at_desc='Output files:  -dv -g -o foo.c '
   2317     $at_quiet $ECHO_N " 17: Output files:  -dv -g -o foo.c               $ECHO_C"
   2318     at_xfail=no
   2319     (
   2320       echo "17. output.at:56: testing ..."
   2321       $at_traceon
   2322 
   2323 case "foo.y" in
   2324   */*) mkdir `echo "foo.y" | sed 's,/.*,,'`;;
   2325 esac
   2326 cat >foo.y <<'_ATEOF'
   2327 
   2328 %%
   2329 foo: {};
   2330 _ATEOF
   2331 
   2332 
   2333 $at_traceoff
   2334 echo "output.at:56: bison -dv -g -o foo.c foo.y "
   2335 echo output.at:56 >$at_check_line_file
   2336 ( $at_traceon; bison -dv -g -o foo.c foo.y  ) >$at_stdout 2>$at_stder1
   2337 at_status=$?
   2338 grep '^ *+' $at_stder1 >&2
   2339 grep -v '^ *+' $at_stder1 >$at_stderr
   2340 at_failed=false
   2341 $at_diff $at_devnull $at_stderr || at_failed=:
   2342 $at_diff $at_devnull $at_stdout || at_failed=:
   2343 case $at_status in
   2344    77) echo 77 > $at_status_file
   2345             exit 77;;
   2346    0) ;;
   2347    *) echo "output.at:56: exit code was $at_status, expected 0"
   2348       at_failed=:;;
   2349 esac
   2350 if $at_failed; then
   2351 
   2352   echo 1 > $at_status_file
   2353   exit 1
   2354 fi
   2355 
   2356 $at_traceon
   2357 
   2358 $at_traceoff
   2359 echo "output.at:56: ls foo.c foo.h foo.output foo.vcg"
   2360 echo output.at:56 >$at_check_line_file
   2361 ( $at_traceon; ls foo.c foo.h foo.output foo.vcg ) >$at_stdout 2>$at_stder1
   2362 at_status=$?
   2363 grep '^ *+' $at_stder1 >&2
   2364 grep -v '^ *+' $at_stder1 >$at_stderr
   2365 at_failed=false
   2366 $at_diff $at_devnull $at_stderr || at_failed=:
   2367 echo stdout:; cat $at_stdout
   2368 case $at_status in
   2369    77) echo 77 > $at_status_file
   2370             exit 77;;
   2371    0) ;;
   2372    *) echo "output.at:56: exit code was $at_status, expected 0"
   2373       at_failed=:;;
   2374 esac
   2375 if $at_failed; then
   2376 
   2377   echo 1 > $at_status_file
   2378   exit 1
   2379 fi
   2380 
   2381 $at_traceon
   2382 
   2383 
   2384       $at_traceoff
   2385       $at_times_p && times >$at_times_file
   2386     ) 5>&1 2>&1 | eval $at_tee_pipe
   2387     at_status=`cat $at_status_file`
   2388     ;;
   2389 
   2390   18 ) # 18. output.at:60: Output files: %defines %verbose
   2391     at_setup_line='output.at:60'
   2392     at_desc='Output files: %defines %verbose  '
   2393     $at_quiet $ECHO_N " 18: Output files: %defines %verbose              $ECHO_C"
   2394     at_xfail=no
   2395     (
   2396       echo "18. output.at:60: testing ..."
   2397       $at_traceon
   2398 
   2399 case "foo.y" in
   2400   */*) mkdir `echo "foo.y" | sed 's,/.*,,'`;;
   2401 esac
   2402 cat >foo.y <<'_ATEOF'
   2403 %defines %verbose
   2404 %%
   2405 foo: {};
   2406 _ATEOF
   2407 
   2408 
   2409 $at_traceoff
   2410 echo "output.at:60: bison  foo.y "
   2411 echo output.at:60 >$at_check_line_file
   2412 ( $at_traceon; bison  foo.y  ) >$at_stdout 2>$at_stder1
   2413 at_status=$?
   2414 grep '^ *+' $at_stder1 >&2
   2415 grep -v '^ *+' $at_stder1 >$at_stderr
   2416 at_failed=false
   2417 $at_diff $at_devnull $at_stderr || at_failed=:
   2418 $at_diff $at_devnull $at_stdout || at_failed=:
   2419 case $at_status in
   2420    77) echo 77 > $at_status_file
   2421             exit 77;;
   2422    0) ;;
   2423    *) echo "output.at:60: exit code was $at_status, expected 0"
   2424       at_failed=:;;
   2425 esac
   2426 if $at_failed; then
   2427 
   2428   echo 1 > $at_status_file
   2429   exit 1
   2430 fi
   2431 
   2432 $at_traceon
   2433 
   2434 $at_traceoff
   2435 echo "output.at:60: ls foo.output foo.tab.c foo.tab.h"
   2436 echo output.at:60 >$at_check_line_file
   2437 ( $at_traceon; ls foo.output foo.tab.c foo.tab.h ) >$at_stdout 2>$at_stder1
   2438 at_status=$?
   2439 grep '^ *+' $at_stder1 >&2
   2440 grep -v '^ *+' $at_stder1 >$at_stderr
   2441 at_failed=false
   2442 $at_diff $at_devnull $at_stderr || at_failed=:
   2443 echo stdout:; cat $at_stdout
   2444 case $at_status in
   2445    77) echo 77 > $at_status_file
   2446             exit 77;;
   2447    0) ;;
   2448    *) echo "output.at:60: exit code was $at_status, expected 0"
   2449       at_failed=:;;
   2450 esac
   2451 if $at_failed; then
   2452 
   2453   echo 1 > $at_status_file
   2454   exit 1
   2455 fi
   2456 
   2457 $at_traceon
   2458 
   2459 
   2460       $at_traceoff
   2461       $at_times_p && times >$at_times_file
   2462     ) 5>&1 2>&1 | eval $at_tee_pipe
   2463     at_status=`cat $at_status_file`
   2464     ;;
   2465 
   2466   19 ) # 19. output.at:62: Output files: %defines %verbose %yacc
   2467     at_setup_line='output.at:62'
   2468     at_desc='Output files: %defines %verbose %yacc  '
   2469     $at_quiet $ECHO_N " 19: Output files: %defines %verbose %yacc        $ECHO_C"
   2470     at_xfail=no
   2471     (
   2472       echo "19. output.at:62: testing ..."
   2473       $at_traceon
   2474 
   2475 case "foo.y" in
   2476   */*) mkdir `echo "foo.y" | sed 's,/.*,,'`;;
   2477 esac
   2478 cat >foo.y <<'_ATEOF'
   2479 %defines %verbose %yacc
   2480 %%
   2481 foo: {};
   2482 _ATEOF
   2483 
   2484 
   2485 $at_traceoff
   2486 echo "output.at:62: bison  foo.y "
   2487 echo output.at:62 >$at_check_line_file
   2488 ( $at_traceon; bison  foo.y  ) >$at_stdout 2>$at_stder1
   2489 at_status=$?
   2490 grep '^ *+' $at_stder1 >&2
   2491 grep -v '^ *+' $at_stder1 >$at_stderr
   2492 at_failed=false
   2493 $at_diff $at_devnull $at_stderr || at_failed=:
   2494 $at_diff $at_devnull $at_stdout || at_failed=:
   2495 case $at_status in
   2496    77) echo 77 > $at_status_file
   2497             exit 77;;
   2498    0) ;;
   2499    *) echo "output.at:62: exit code was $at_status, expected 0"
   2500       at_failed=:;;
   2501 esac
   2502 if $at_failed; then
   2503 
   2504   echo 1 > $at_status_file
   2505   exit 1
   2506 fi
   2507 
   2508 $at_traceon
   2509 
   2510 $at_traceoff
   2511 echo "output.at:62: ls y.output y.tab.c y.tab.h"
   2512 echo output.at:62 >$at_check_line_file
   2513 ( $at_traceon; ls y.output y.tab.c y.tab.h ) >$at_stdout 2>$at_stder1
   2514 at_status=$?
   2515 grep '^ *+' $at_stder1 >&2
   2516 grep -v '^ *+' $at_stder1 >$at_stderr
   2517 at_failed=false
   2518 $at_diff $at_devnull $at_stderr || at_failed=:
   2519 echo stdout:; cat $at_stdout
   2520 case $at_status in
   2521    77) echo 77 > $at_status_file
   2522             exit 77;;
   2523    0) ;;
   2524    *) echo "output.at:62: exit code was $at_status, expected 0"
   2525       at_failed=:;;
   2526 esac
   2527 if $at_failed; then
   2528 
   2529   echo 1 > $at_status_file
   2530   exit 1
   2531 fi
   2532 
   2533 $at_traceon
   2534 
   2535 
   2536       $at_traceoff
   2537       $at_times_p && times >$at_times_file
   2538     ) 5>&1 2>&1 | eval $at_tee_pipe
   2539     at_status=`cat $at_status_file`
   2540     ;;
   2541 
   2542   20 ) # 20. output.at:65: Output files: %defines %verbose %yacc
   2543     at_setup_line='output.at:65'
   2544     at_desc='Output files: %defines %verbose %yacc  '
   2545     $at_quiet $ECHO_N " 20: Output files: %defines %verbose %yacc        $ECHO_C"
   2546     at_xfail=no
   2547     (
   2548       echo "20. output.at:65: testing ..."
   2549       $at_traceon
   2550 
   2551 case "foo.yy" in
   2552   */*) mkdir `echo "foo.yy" | sed 's,/.*,,'`;;
   2553 esac
   2554 cat >foo.yy <<'_ATEOF'
   2555 %defines %verbose %yacc
   2556 %%
   2557 foo: {};
   2558 _ATEOF
   2559 
   2560 
   2561 $at_traceoff
   2562 echo "output.at:65: bison  foo.yy "
   2563 echo output.at:65 >$at_check_line_file
   2564 ( $at_traceon; bison  foo.yy  ) >$at_stdout 2>$at_stder1
   2565 at_status=$?
   2566 grep '^ *+' $at_stder1 >&2
   2567 grep -v '^ *+' $at_stder1 >$at_stderr
   2568 at_failed=false
   2569 $at_diff $at_devnull $at_stderr || at_failed=:
   2570 $at_diff $at_devnull $at_stdout || at_failed=:
   2571 case $at_status in
   2572    77) echo 77 > $at_status_file
   2573             exit 77;;
   2574    0) ;;
   2575    *) echo "output.at:65: exit code was $at_status, expected 0"
   2576       at_failed=:;;
   2577 esac
   2578 if $at_failed; then
   2579 
   2580   echo 1 > $at_status_file
   2581   exit 1
   2582 fi
   2583 
   2584 $at_traceon
   2585 
   2586 $at_traceoff
   2587 echo "output.at:65: ls y.output y.tab.c y.tab.h"
   2588 echo output.at:65 >$at_check_line_file
   2589 ( $at_traceon; ls y.output y.tab.c y.tab.h ) >$at_stdout 2>$at_stder1
   2590 at_status=$?
   2591 grep '^ *+' $at_stder1 >&2
   2592 grep -v '^ *+' $at_stder1 >$at_stderr
   2593 at_failed=false
   2594 $at_diff $at_devnull $at_stderr || at_failed=:
   2595 echo stdout:; cat $at_stdout
   2596 case $at_status in
   2597    77) echo 77 > $at_status_file
   2598             exit 77;;
   2599    0) ;;
   2600    *) echo "output.at:65: exit code was $at_status, expected 0"
   2601       at_failed=:;;
   2602 esac
   2603 if $at_failed; then
   2604 
   2605   echo 1 > $at_status_file
   2606   exit 1
   2607 fi
   2608 
   2609 $at_traceon
   2610 
   2611 
   2612       $at_traceoff
   2613       $at_times_p && times >$at_times_file
   2614     ) 5>&1 2>&1 | eval $at_tee_pipe
   2615     at_status=`cat $at_status_file`
   2616     ;;
   2617 
   2618   21 ) # 21. output.at:69: Output files: %file-prefix="bar" %defines %verbose
   2619     at_setup_line='output.at:69'
   2620     at_desc='Output files: %file-prefix="bar" %defines %verbose  '
   2621     $at_quiet $ECHO_N " 21: Output files: %file-prefix="bar" %defines %verbose  $ECHO_C"
   2622     at_xfail=no
   2623     (
   2624       echo "21. output.at:69: testing ..."
   2625       $at_traceon
   2626 
   2627 case "foo.y" in
   2628   */*) mkdir `echo "foo.y" | sed 's,/.*,,'`;;
   2629 esac
   2630 cat >foo.y <<'_ATEOF'
   2631 %file-prefix="bar" %defines %verbose
   2632 %%
   2633 foo: {};
   2634 _ATEOF
   2635 
   2636 
   2637 $at_traceoff
   2638 echo "output.at:69: bison  foo.y "
   2639 echo output.at:69 >$at_check_line_file
   2640 ( $at_traceon; bison  foo.y  ) >$at_stdout 2>$at_stder1
   2641 at_status=$?
   2642 grep '^ *+' $at_stder1 >&2
   2643 grep -v '^ *+' $at_stder1 >$at_stderr
   2644 at_failed=false
   2645 $at_diff $at_devnull $at_stderr || at_failed=:
   2646 $at_diff $at_devnull $at_stdout || at_failed=:
   2647 case $at_status in
   2648    77) echo 77 > $at_status_file
   2649             exit 77;;
   2650    0) ;;
   2651    *) echo "output.at:69: exit code was $at_status, expected 0"
   2652       at_failed=:;;
   2653 esac
   2654 if $at_failed; then
   2655 
   2656   echo 1 > $at_status_file
   2657   exit 1
   2658 fi
   2659 
   2660 $at_traceon
   2661 
   2662 $at_traceoff
   2663 echo "output.at:69: ls bar.output bar.tab.c bar.tab.h"
   2664 echo output.at:69 >$at_check_line_file
   2665 ( $at_traceon; ls bar.output bar.tab.c bar.tab.h ) >$at_stdout 2>$at_stder1
   2666 at_status=$?
   2667 grep '^ *+' $at_stder1 >&2
   2668 grep -v '^ *+' $at_stder1 >$at_stderr
   2669 at_failed=false
   2670 $at_diff $at_devnull $at_stderr || at_failed=:
   2671 echo stdout:; cat $at_stdout
   2672 case $at_status in
   2673    77) echo 77 > $at_status_file
   2674             exit 77;;
   2675    0) ;;
   2676    *) echo "output.at:69: exit code was $at_status, expected 0"
   2677       at_failed=:;;
   2678 esac
   2679 if $at_failed; then
   2680 
   2681   echo 1 > $at_status_file
   2682   exit 1
   2683 fi
   2684 
   2685 $at_traceon
   2686 
   2687 
   2688       $at_traceoff
   2689       $at_times_p && times >$at_times_file
   2690     ) 5>&1 2>&1 | eval $at_tee_pipe
   2691     at_status=`cat $at_status_file`
   2692     ;;
   2693 
   2694   22 ) # 22. output.at:71: Output files: %output="bar.c" %defines %verbose %yacc
   2695     at_setup_line='output.at:71'
   2696     at_desc='Output files: %output="bar.c" %defines %verbose %yacc  '
   2697     $at_quiet $ECHO_N " 22: Output files: %output="bar.c" %defines %verbose %yacc  $ECHO_C"
   2698     at_xfail=no
   2699     (
   2700       echo "22. output.at:71: testing ..."
   2701       $at_traceon
   2702 
   2703 case "foo.y" in
   2704   */*) mkdir `echo "foo.y" | sed 's,/.*,,'`;;
   2705 esac
   2706 cat >foo.y <<'_ATEOF'
   2707 %output="bar.c" %defines %verbose %yacc
   2708 %%
   2709 foo: {};
   2710 _ATEOF
   2711 
   2712 
   2713 $at_traceoff
   2714 echo "output.at:71: bison  foo.y "
   2715 echo output.at:71 >$at_check_line_file
   2716 ( $at_traceon; bison  foo.y  ) >$at_stdout 2>$at_stder1
   2717 at_status=$?
   2718 grep '^ *+' $at_stder1 >&2
   2719 grep -v '^ *+' $at_stder1 >$at_stderr
   2720 at_failed=false
   2721 $at_diff $at_devnull $at_stderr || at_failed=:
   2722 $at_diff $at_devnull $at_stdout || at_failed=:
   2723 case $at_status in
   2724    77) echo 77 > $at_status_file
   2725             exit 77;;
   2726    0) ;;
   2727    *) echo "output.at:71: exit code was $at_status, expected 0"
   2728       at_failed=:;;
   2729 esac
   2730 if $at_failed; then
   2731 
   2732   echo 1 > $at_status_file
   2733   exit 1
   2734 fi
   2735 
   2736 $at_traceon
   2737 
   2738 $at_traceoff
   2739 echo "output.at:71: ls bar.output bar.c bar.h"
   2740 echo output.at:71 >$at_check_line_file
   2741 ( $at_traceon; ls bar.output bar.c bar.h ) >$at_stdout 2>$at_stder1
   2742 at_status=$?
   2743 grep '^ *+' $at_stder1 >&2
   2744 grep -v '^ *+' $at_stder1 >$at_stderr
   2745 at_failed=false
   2746 $at_diff $at_devnull $at_stderr || at_failed=:
   2747 echo stdout:; cat $at_stdout
   2748 case $at_status in
   2749    77) echo 77 > $at_status_file
   2750             exit 77;;
   2751    0) ;;
   2752    *) echo "output.at:71: exit code was $at_status, expected 0"
   2753       at_failed=:;;
   2754 esac
   2755 if $at_failed; then
   2756 
   2757   echo 1 > $at_status_file
   2758   exit 1
   2759 fi
   2760 
   2761 $at_traceon
   2762 
   2763 
   2764       $at_traceoff
   2765       $at_times_p && times >$at_times_file
   2766     ) 5>&1 2>&1 | eval $at_tee_pipe
   2767     at_status=`cat $at_status_file`
   2768     ;;
   2769 
   2770   23 ) # 23. output.at:75: Output files: %file-prefix="baz" %output="bar.c" %defines %verbose %yacc
   2771     at_setup_line='output.at:75'
   2772     at_desc='Output files: %file-prefix="baz" %output="bar.c" %defines %verbose %yacc  '
   2773     $at_quiet $ECHO_N " 23: Output files: %file-prefix="baz" %output="bar.c" %defines %verbose %yacc  $ECHO_C"
   2774     at_xfail=no
   2775     (
   2776       echo "23. output.at:75: testing ..."
   2777       $at_traceon
   2778 
   2779 case "foo.y" in
   2780   */*) mkdir `echo "foo.y" | sed 's,/.*,,'`;;
   2781 esac
   2782 cat >foo.y <<'_ATEOF'
   2783 %file-prefix="baz" %output="bar.c" %defines %verbose %yacc
   2784 %%
   2785 foo: {};
   2786 _ATEOF
   2787 
   2788 
   2789 $at_traceoff
   2790 echo "output.at:75: bison  foo.y "
   2791 echo output.at:75 >$at_check_line_file
   2792 ( $at_traceon; bison  foo.y  ) >$at_stdout 2>$at_stder1
   2793 at_status=$?
   2794 grep '^ *+' $at_stder1 >&2
   2795 grep -v '^ *+' $at_stder1 >$at_stderr
   2796 at_failed=false
   2797 $at_diff $at_devnull $at_stderr || at_failed=:
   2798 $at_diff $at_devnull $at_stdout || at_failed=:
   2799 case $at_status in
   2800    77) echo 77 > $at_status_file
   2801             exit 77;;
   2802    0) ;;
   2803    *) echo "output.at:75: exit code was $at_status, expected 0"
   2804       at_failed=:;;
   2805 esac
   2806 if $at_failed; then
   2807 
   2808   echo 1 > $at_status_file
   2809   exit 1
   2810 fi
   2811 
   2812 $at_traceon
   2813 
   2814 $at_traceoff
   2815 echo "output.at:75: ls bar.output bar.c bar.h"
   2816 echo output.at:75 >$at_check_line_file
   2817 ( $at_traceon; ls bar.output bar.c bar.h ) >$at_stdout 2>$at_stder1
   2818 at_status=$?
   2819 grep '^ *+' $at_stder1 >&2
   2820 grep -v '^ *+' $at_stder1 >$at_stderr
   2821 at_failed=false
   2822 $at_diff $at_devnull $at_stderr || at_failed=:
   2823 echo stdout:; cat $at_stdout
   2824 case $at_status in
   2825    77) echo 77 > $at_status_file
   2826             exit 77;;
   2827    0) ;;
   2828    *) echo "output.at:75: exit code was $at_status, expected 0"
   2829       at_failed=:;;
   2830 esac
   2831 if $at_failed; then
   2832 
   2833   echo 1 > $at_status_file
   2834   exit 1
   2835 fi
   2836 
   2837 $at_traceon
   2838 
   2839 
   2840       $at_traceoff
   2841       $at_times_p && times >$at_times_file
   2842     ) 5>&1 2>&1 | eval $at_tee_pipe
   2843     at_status=`cat $at_status_file`
   2844     ;;
   2845 
   2846   24 ) # 24. output.at:80: Output files: %defines %verbose
   2847     at_setup_line='output.at:80'
   2848     at_desc='Output files: %defines %verbose  '
   2849     $at_quiet $ECHO_N " 24: Output files: %defines %verbose              $ECHO_C"
   2850     at_xfail=no
   2851     (
   2852       echo "24. output.at:80: testing ..."
   2853       $at_traceon
   2854 
   2855 case "foo.yy" in
   2856   */*) mkdir `echo "foo.yy" | sed 's,/.*,,'`;;
   2857 esac
   2858 cat >foo.yy <<'_ATEOF'
   2859 %defines %verbose
   2860 %%
   2861 foo: {};
   2862 _ATEOF
   2863 
   2864 
   2865 $at_traceoff
   2866 echo "output.at:80: bison  foo.yy "
   2867 echo output.at:80 >$at_check_line_file
   2868 ( $at_traceon; bison  foo.yy  ) >$at_stdout 2>$at_stder1
   2869 at_status=$?
   2870 grep '^ *+' $at_stder1 >&2
   2871 grep -v '^ *+' $at_stder1 >$at_stderr
   2872 at_failed=false
   2873 $at_diff $at_devnull $at_stderr || at_failed=:
   2874 $at_diff $at_devnull $at_stdout || at_failed=:
   2875 case $at_status in
   2876    77) echo 77 > $at_status_file
   2877             exit 77;;
   2878    0) ;;
   2879    *) echo "output.at:80: exit code was $at_status, expected 0"
   2880       at_failed=:;;
   2881 esac
   2882 if $at_failed; then
   2883 
   2884   echo 1 > $at_status_file
   2885   exit 1
   2886 fi
   2887 
   2888 $at_traceon
   2889 
   2890 $at_traceoff
   2891 echo "output.at:80: ls foo.output foo.tab.cc foo.tab.hh"
   2892 echo output.at:80 >$at_check_line_file
   2893 ( $at_traceon; ls foo.output foo.tab.cc foo.tab.hh ) >$at_stdout 2>$at_stder1
   2894 at_status=$?
   2895 grep '^ *+' $at_stder1 >&2
   2896 grep -v '^ *+' $at_stder1 >$at_stderr
   2897 at_failed=false
   2898 $at_diff $at_devnull $at_stderr || at_failed=:
   2899 echo stdout:; cat $at_stdout
   2900 case $at_status in
   2901    77) echo 77 > $at_status_file
   2902             exit 77;;
   2903    0) ;;
   2904    *) echo "output.at:80: exit code was $at_status, expected 0"
   2905       at_failed=:;;
   2906 esac
   2907 if $at_failed; then
   2908 
   2909   echo 1 > $at_status_file
   2910   exit 1
   2911 fi
   2912 
   2913 $at_traceon
   2914 
   2915 
   2916       $at_traceoff
   2917       $at_times_p && times >$at_times_file
   2918     ) 5>&1 2>&1 | eval $at_tee_pipe
   2919     at_status=`cat $at_status_file`
   2920     ;;
   2921 
   2922   25 ) # 25. output.at:83: Output files: %defines %verbose  -o foo.c
   2923     at_setup_line='output.at:83'
   2924     at_desc='Output files: %defines %verbose  -o foo.c '
   2925     $at_quiet $ECHO_N " 25: Output files: %defines %verbose  -o foo.c    $ECHO_C"
   2926     at_xfail=no
   2927     (
   2928       echo "25. output.at:83: testing ..."
   2929       $at_traceon
   2930 
   2931 case "foo.yy" in
   2932   */*) mkdir `echo "foo.yy" | sed 's,/.*,,'`;;
   2933 esac
   2934 cat >foo.yy <<'_ATEOF'
   2935 %defines %verbose
   2936 %%
   2937 foo: {};
   2938 _ATEOF
   2939 
   2940 
   2941 $at_traceoff
   2942 echo "output.at:83: bison -o foo.c foo.yy "
   2943 echo output.at:83 >$at_check_line_file
   2944 ( $at_traceon; bison -o foo.c foo.yy  ) >$at_stdout 2>$at_stder1
   2945 at_status=$?
   2946 grep '^ *+' $at_stder1 >&2
   2947 grep -v '^ *+' $at_stder1 >$at_stderr
   2948 at_failed=false
   2949 $at_diff $at_devnull $at_stderr || at_failed=:
   2950 $at_diff $at_devnull $at_stdout || at_failed=:
   2951 case $at_status in
   2952    77) echo 77 > $at_status_file
   2953             exit 77;;
   2954    0) ;;
   2955    *) echo "output.at:83: exit code was $at_status, expected 0"
   2956       at_failed=:;;
   2957 esac
   2958 if $at_failed; then
   2959 
   2960   echo 1 > $at_status_file
   2961   exit 1
   2962 fi
   2963 
   2964 $at_traceon
   2965 
   2966 $at_traceoff
   2967 echo "output.at:83: ls foo.c foo.h foo.output"
   2968 echo output.at:83 >$at_check_line_file
   2969 ( $at_traceon; ls foo.c foo.h foo.output ) >$at_stdout 2>$at_stder1
   2970 at_status=$?
   2971 grep '^ *+' $at_stder1 >&2
   2972 grep -v '^ *+' $at_stder1 >$at_stderr
   2973 at_failed=false
   2974 $at_diff $at_devnull $at_stderr || at_failed=:
   2975 echo stdout:; cat $at_stdout
   2976 case $at_status in
   2977    77) echo 77 > $at_status_file
   2978             exit 77;;
   2979    0) ;;
   2980    *) echo "output.at:83: exit code was $at_status, expected 0"
   2981       at_failed=:;;
   2982 esac
   2983 if $at_failed; then
   2984 
   2985   echo 1 > $at_status_file
   2986   exit 1
   2987 fi
   2988 
   2989 $at_traceon
   2990 
   2991 
   2992       $at_traceoff
   2993       $at_times_p && times >$at_times_file
   2994     ) 5>&1 2>&1 | eval $at_tee_pipe
   2995     at_status=`cat $at_status_file`
   2996     ;;
   2997 
   2998   26 ) # 26. output.at:87: Output files:  --defines=foo.hpp -o foo.c++
   2999     at_setup_line='output.at:87'
   3000     at_desc='Output files:  --defines=foo.hpp -o foo.c++ '
   3001     $at_quiet $ECHO_N " 26: Output files:  --defines=foo.hpp -o foo.c++  $ECHO_C"
   3002     at_xfail=no
   3003     (
   3004       echo "26. output.at:87: testing ..."
   3005       $at_traceon
   3006 
   3007 case "foo.yy" in
   3008   */*) mkdir `echo "foo.yy" | sed 's,/.*,,'`;;
   3009 esac
   3010 cat >foo.yy <<'_ATEOF'
   3011 
   3012 %%
   3013 foo: {};
   3014 _ATEOF
   3015 
   3016 
   3017 $at_traceoff
   3018 echo "output.at:87: bison --defines=foo.hpp -o foo.c++ foo.yy "
   3019 echo output.at:87 >$at_check_line_file
   3020 ( $at_traceon; bison --defines=foo.hpp -o foo.c++ foo.yy  ) >$at_stdout 2>$at_stder1
   3021 at_status=$?
   3022 grep '^ *+' $at_stder1 >&2
   3023 grep -v '^ *+' $at_stder1 >$at_stderr
   3024 at_failed=false
   3025 $at_diff $at_devnull $at_stderr || at_failed=:
   3026 $at_diff $at_devnull $at_stdout || at_failed=:
   3027 case $at_status in
   3028    77) echo 77 > $at_status_file
   3029             exit 77;;
   3030    0) ;;
   3031    *) echo "output.at:87: exit code was $at_status, expected 0"
   3032       at_failed=:;;
   3033 esac
   3034 if $at_failed; then
   3035 
   3036   echo 1 > $at_status_file
   3037   exit 1
   3038 fi
   3039 
   3040 $at_traceon
   3041 
   3042 $at_traceoff
   3043 echo "output.at:87: ls foo.c++ foo.hpp"
   3044 echo output.at:87 >$at_check_line_file
   3045 ( $at_traceon; ls foo.c++ foo.hpp ) >$at_stdout 2>$at_stder1
   3046 at_status=$?
   3047 grep '^ *+' $at_stder1 >&2
   3048 grep -v '^ *+' $at_stder1 >$at_stderr
   3049 at_failed=false
   3050 $at_diff $at_devnull $at_stderr || at_failed=:
   3051 echo stdout:; cat $at_stdout
   3052 case $at_status in
   3053    77) echo 77 > $at_status_file
   3054             exit 77;;
   3055    0) ;;
   3056    *) echo "output.at:87: exit code was $at_status, expected 0"
   3057       at_failed=:;;
   3058 esac
   3059 if $at_failed; then
   3060 
   3061   echo 1 > $at_status_file
   3062   exit 1
   3063 fi
   3064 
   3065 $at_traceon
   3066 
   3067 
   3068       $at_traceoff
   3069       $at_times_p && times >$at_times_file
   3070     ) 5>&1 2>&1 | eval $at_tee_pipe
   3071     at_status=`cat $at_status_file`
   3072     ;;
   3073 
   3074   27 ) # 27. output.at:91: Output files:  -o foo.c++ --graph=foo.gph
   3075     at_setup_line='output.at:91'
   3076     at_desc='Output files:  -o foo.c++ --graph=foo.gph '
   3077     $at_quiet $ECHO_N " 27: Output files:  -o foo.c++ --graph=foo.gph    $ECHO_C"
   3078     at_xfail=no
   3079     (
   3080       echo "27. output.at:91: testing ..."
   3081       $at_traceon
   3082 
   3083 case "foo.yy" in
   3084   */*) mkdir `echo "foo.yy" | sed 's,/.*,,'`;;
   3085 esac
   3086 cat >foo.yy <<'_ATEOF'
   3087 
   3088 %%
   3089 foo: {};
   3090 _ATEOF
   3091 
   3092 
   3093 $at_traceoff
   3094 echo "output.at:91: bison -o foo.c++ --graph=foo.gph foo.yy "
   3095 echo output.at:91 >$at_check_line_file
   3096 ( $at_traceon; bison -o foo.c++ --graph=foo.gph foo.yy  ) >$at_stdout 2>$at_stder1
   3097 at_status=$?
   3098 grep '^ *+' $at_stder1 >&2
   3099 grep -v '^ *+' $at_stder1 >$at_stderr
   3100 at_failed=false
   3101 $at_diff $at_devnull $at_stderr || at_failed=:
   3102 $at_diff $at_devnull $at_stdout || at_failed=:
   3103 case $at_status in
   3104    77) echo 77 > $at_status_file
   3105             exit 77;;
   3106    0) ;;
   3107    *) echo "output.at:91: exit code was $at_status, expected 0"
   3108       at_failed=:;;
   3109 esac
   3110 if $at_failed; then
   3111 
   3112   echo 1 > $at_status_file
   3113   exit 1
   3114 fi
   3115 
   3116 $at_traceon
   3117 
   3118 $at_traceoff
   3119 echo "output.at:91: ls foo.c++ foo.gph"
   3120 echo output.at:91 >$at_check_line_file
   3121 ( $at_traceon; ls foo.c++ foo.gph ) >$at_stdout 2>$at_stder1
   3122 at_status=$?
   3123 grep '^ *+' $at_stder1 >&2
   3124 grep -v '^ *+' $at_stder1 >$at_stderr
   3125 at_failed=false
   3126 $at_diff $at_devnull $at_stderr || at_failed=:
   3127 echo stdout:; cat $at_stdout
   3128 case $at_status in
   3129    77) echo 77 > $at_status_file
   3130             exit 77;;
   3131    0) ;;
   3132    *) echo "output.at:91: exit code was $at_status, expected 0"
   3133       at_failed=:;;
   3134 esac
   3135 if $at_failed; then
   3136 
   3137   echo 1 > $at_status_file
   3138   exit 1
   3139 fi
   3140 
   3141 $at_traceon
   3142 
   3143 
   3144       $at_traceoff
   3145       $at_times_p && times >$at_times_file
   3146     ) 5>&1 2>&1 | eval $at_tee_pipe
   3147     at_status=`cat $at_status_file`
   3148     ;;
   3149 
   3150   28 ) # 28. output.at:105: Output files: %skeleton "lalr1.cc" %defines %verbose
   3151     at_setup_line='output.at:105'
   3152     at_desc='Output files: %skeleton "lalr1.cc" %defines %verbose  '
   3153     $at_quiet $ECHO_N " 28: Output files: %skeleton "lalr1.cc" %defines %verbose  $ECHO_C"
   3154     at_xfail=no
   3155     (
   3156       echo "28. output.at:105: testing ..."
   3157       $at_traceon
   3158 
   3159 case "foo.yy" in
   3160   */*) mkdir `echo "foo.yy" | sed 's,/.*,,'`;;
   3161 esac
   3162 cat >foo.yy <<'_ATEOF'
   3163 %skeleton "lalr1.cc" %defines %verbose
   3164 %%
   3165 foo: {};
   3166 _ATEOF
   3167 
   3168 
   3169 $at_traceoff
   3170 echo "output.at:105: bison  foo.yy "
   3171 echo output.at:105 >$at_check_line_file
   3172 ( $at_traceon; bison  foo.yy  ) >$at_stdout 2>$at_stder1
   3173 at_status=$?
   3174 grep '^ *+' $at_stder1 >&2
   3175 grep -v '^ *+' $at_stder1 >$at_stderr
   3176 at_failed=false
   3177 $at_diff $at_devnull $at_stderr || at_failed=:
   3178 $at_diff $at_devnull $at_stdout || at_failed=:
   3179 case $at_status in
   3180    77) echo 77 > $at_status_file
   3181             exit 77;;
   3182    0) ;;
   3183    *) echo "output.at:105: exit code was $at_status, expected 0"
   3184       at_failed=:;;
   3185 esac
   3186 if $at_failed; then
   3187 
   3188   echo 1 > $at_status_file
   3189   exit 1
   3190 fi
   3191 
   3192 $at_traceon
   3193 
   3194 $at_traceoff
   3195 echo "output.at:105: ls foo.tab.cc foo.tab.hh foo.output location.hh stack.hh position.hh"
   3196 echo output.at:105 >$at_check_line_file
   3197 ( $at_traceon; ls foo.tab.cc foo.tab.hh foo.output location.hh stack.hh position.hh ) >$at_stdout 2>$at_stder1
   3198 at_status=$?
   3199 grep '^ *+' $at_stder1 >&2
   3200 grep -v '^ *+' $at_stder1 >$at_stderr
   3201 at_failed=false
   3202 $at_diff $at_devnull $at_stderr || at_failed=:
   3203 echo stdout:; cat $at_stdout
   3204 case $at_status in
   3205    77) echo 77 > $at_status_file
   3206             exit 77;;
   3207    0) ;;
   3208    *) echo "output.at:105: exit code was $at_status, expected 0"
   3209       at_failed=:;;
   3210 esac
   3211 if $at_failed; then
   3212 
   3213   echo 1 > $at_status_file
   3214   exit 1
   3215 fi
   3216 
   3217 $at_traceon
   3218 
   3219 
   3220       $at_traceoff
   3221       $at_times_p && times >$at_times_file
   3222     ) 5>&1 2>&1 | eval $at_tee_pipe
   3223     at_status=`cat $at_status_file`
   3224     ;;
   3225 
   3226   29 ) # 29. output.at:109: Output files: %skeleton "lalr1.cc" %defines %verbose
   3227     at_setup_line='output.at:109'
   3228     at_desc='Output files: %skeleton "lalr1.cc" %defines %verbose  '
   3229     $at_quiet $ECHO_N " 29: Output files: %skeleton "lalr1.cc" %defines %verbose  $ECHO_C"
   3230     at_xfail=no
   3231     (
   3232       echo "29. output.at:109: testing ..."
   3233       $at_traceon
   3234 
   3235 case "subdir/foo.yy" in
   3236   */*) mkdir `echo "subdir/foo.yy" | sed 's,/.*,,'`;;
   3237 esac
   3238 cat >subdir/foo.yy <<'_ATEOF'
   3239 %skeleton "lalr1.cc" %defines %verbose
   3240 %%
   3241 foo: {};
   3242 _ATEOF
   3243 
   3244 
   3245 $at_traceoff
   3246 echo "output.at:109: bison  subdir/foo.yy "
   3247 echo output.at:109 >$at_check_line_file
   3248 ( $at_traceon; bison  subdir/foo.yy  ) >$at_stdout 2>$at_stder1
   3249 at_status=$?
   3250 grep '^ *+' $at_stder1 >&2
   3251 grep -v '^ *+' $at_stder1 >$at_stderr
   3252 at_failed=false
   3253 $at_diff $at_devnull $at_stderr || at_failed=:
   3254 $at_diff $at_devnull $at_stdout || at_failed=:
   3255 case $at_status in
   3256    77) echo 77 > $at_status_file
   3257             exit 77;;
   3258    0) ;;
   3259    *) echo "output.at:109: exit code was $at_status, expected 0"
   3260       at_failed=:;;
   3261 esac
   3262 if $at_failed; then
   3263 
   3264   echo 1 > $at_status_file
   3265   exit 1
   3266 fi
   3267 
   3268 $at_traceon
   3269 
   3270 $at_traceoff
   3271 echo "output.at:109: ls foo.tab.cc foo.tab.hh foo.output location.hh stack.hh position.hh"
   3272 echo output.at:109 >$at_check_line_file
   3273 ( $at_traceon; ls foo.tab.cc foo.tab.hh foo.output location.hh stack.hh position.hh ) >$at_stdout 2>$at_stder1
   3274 at_status=$?
   3275 grep '^ *+' $at_stder1 >&2
   3276 grep -v '^ *+' $at_stder1 >$at_stderr
   3277 at_failed=false
   3278 $at_diff $at_devnull $at_stderr || at_failed=:
   3279 echo stdout:; cat $at_stdout
   3280 case $at_status in
   3281    77) echo 77 > $at_status_file
   3282             exit 77;;
   3283    0) ;;
   3284    *) echo "output.at:109: exit code was $at_status, expected 0"
   3285       at_failed=:;;
   3286 esac
   3287 if $at_failed; then
   3288 
   3289   echo 1 > $at_status_file
   3290   exit 1
   3291 fi
   3292 
   3293 $at_traceon
   3294 
   3295 # Also make sure that the includes do not refer to the subdirectory.
   3296 $at_traceoff
   3297 echo "output.at:109: grep 'include .subdir/' foo.tab.cc"
   3298 echo output.at:109 >$at_check_line_file
   3299 ( $at_traceon; grep 'include .subdir/' foo.tab.cc ) >$at_stdout 2>$at_stder1
   3300 at_status=$?
   3301 grep '^ *+' $at_stder1 >&2
   3302 grep -v '^ *+' $at_stder1 >$at_stderr
   3303 at_failed=false
   3304 $at_diff $at_devnull $at_stderr || at_failed=:
   3305 $at_diff $at_devnull $at_stdout || at_failed=:
   3306 case $at_status in
   3307    77) echo 77 > $at_status_file
   3308             exit 77;;
   3309    1) ;;
   3310    *) echo "output.at:109: exit code was $at_status, expected 1"
   3311       at_failed=:;;
   3312 esac
   3313 if $at_failed; then
   3314 
   3315   echo 1 > $at_status_file
   3316   exit 1
   3317 fi
   3318 
   3319 $at_traceon
   3320 
   3321 $at_traceoff
   3322 echo "output.at:109: grep 'include .subdir/' foo.tab.hh"
   3323 echo output.at:109 >$at_check_line_file
   3324 ( $at_traceon; grep 'include .subdir/' foo.tab.hh ) >$at_stdout 2>$at_stder1
   3325 at_status=$?
   3326 grep '^ *+' $at_stder1 >&2
   3327 grep -v '^ *+' $at_stder1 >$at_stderr
   3328 at_failed=false
   3329 $at_diff $at_devnull $at_stderr || at_failed=:
   3330 $at_diff $at_devnull $at_stdout || at_failed=:
   3331 case $at_status in
   3332    77) echo 77 > $at_status_file
   3333             exit 77;;
   3334    1) ;;
   3335    *) echo "output.at:109: exit code was $at_status, expected 1"
   3336       at_failed=:;;
   3337 esac
   3338 if $at_failed; then
   3339 
   3340   echo 1 > $at_status_file
   3341   exit 1
   3342 fi
   3343 
   3344 $at_traceon
   3345 
   3346 
   3347       $at_traceoff
   3348       $at_times_p && times >$at_times_file
   3349     ) 5>&1 2>&1 | eval $at_tee_pipe
   3350     at_status=`cat $at_status_file`
   3351     ;;
   3352 
   3353   30 ) # 30. output.at:114: Output files: %skeleton "lalr1.cc" %defines %verbose -o subdir/foo.cc
   3354     at_setup_line='output.at:114'
   3355     at_desc='Output files: %skeleton "lalr1.cc" %defines %verbose -o subdir/foo.cc '
   3356     $at_quiet $ECHO_N " 30: Output files: %skeleton "lalr1.cc" %defines %verbose -o subdir/foo.cc $ECHO_C"
   3357     at_xfail=no
   3358     (
   3359       echo "30. output.at:114: testing ..."
   3360       $at_traceon
   3361 
   3362 case "subdir/foo.yy" in
   3363   */*) mkdir `echo "subdir/foo.yy" | sed 's,/.*,,'`;;
   3364 esac
   3365 cat >subdir/foo.yy <<'_ATEOF'
   3366 %skeleton "lalr1.cc" %defines %verbose
   3367 %%
   3368 foo: {};
   3369 _ATEOF
   3370 
   3371 
   3372 $at_traceoff
   3373 echo "output.at:114: bison -o subdir/foo.cc subdir/foo.yy "
   3374 echo output.at:114 >$at_check_line_file
   3375 ( $at_traceon; bison -o subdir/foo.cc subdir/foo.yy  ) >$at_stdout 2>$at_stder1
   3376 at_status=$?
   3377 grep '^ *+' $at_stder1 >&2
   3378 grep -v '^ *+' $at_stder1 >$at_stderr
   3379 at_failed=false
   3380 $at_diff $at_devnull $at_stderr || at_failed=:
   3381 $at_diff $at_devnull $at_stdout || at_failed=:
   3382 case $at_status in
   3383    77) echo 77 > $at_status_file
   3384             exit 77;;
   3385    0) ;;
   3386    *) echo "output.at:114: exit code was $at_status, expected 0"
   3387       at_failed=:;;
   3388 esac
   3389 if $at_failed; then
   3390 
   3391   echo 1 > $at_status_file
   3392   exit 1
   3393 fi
   3394 
   3395 $at_traceon
   3396 
   3397 $at_traceoff
   3398 echo "output.at:114: ls subdir/foo.cc subdir/foo.hh subdir/foo.output subdir/location.hh subdir/stack.hh subdir/position.hh"
   3399 echo output.at:114 >$at_check_line_file
   3400 ( $at_traceon; ls subdir/foo.cc subdir/foo.hh subdir/foo.output subdir/location.hh subdir/stack.hh subdir/position.hh ) >$at_stdout 2>$at_stder1
   3401 at_status=$?
   3402 grep '^ *+' $at_stder1 >&2
   3403 grep -v '^ *+' $at_stder1 >$at_stderr
   3404 at_failed=false
   3405 $at_diff $at_devnull $at_stderr || at_failed=:
   3406 echo stdout:; cat $at_stdout
   3407 case $at_status in
   3408    77) echo 77 > $at_status_file
   3409             exit 77;;
   3410    0) ;;
   3411    *) echo "output.at:114: exit code was $at_status, expected 0"
   3412       at_failed=:;;
   3413 esac
   3414 if $at_failed; then
   3415 
   3416   echo 1 > $at_status_file
   3417   exit 1
   3418 fi
   3419 
   3420 $at_traceon
   3421 
   3422 # Also make sure that the includes do not refer to the subdirectory.
   3423 $at_traceoff
   3424 echo "output.at:114: grep 'include .subdir/' subdir/foo.cc"
   3425 echo output.at:114 >$at_check_line_file
   3426 ( $at_traceon; grep 'include .subdir/' subdir/foo.cc ) >$at_stdout 2>$at_stder1
   3427 at_status=$?
   3428 grep '^ *+' $at_stder1 >&2
   3429 grep -v '^ *+' $at_stder1 >$at_stderr
   3430 at_failed=false
   3431 $at_diff $at_devnull $at_stderr || at_failed=:
   3432 $at_diff $at_devnull $at_stdout || at_failed=:
   3433 case $at_status in
   3434    77) echo 77 > $at_status_file
   3435             exit 77;;
   3436    1) ;;
   3437    *) echo "output.at:114: exit code was $at_status, expected 1"
   3438       at_failed=:;;
   3439 esac
   3440 if $at_failed; then
   3441 
   3442   echo 1 > $at_status_file
   3443   exit 1
   3444 fi
   3445 
   3446 $at_traceon
   3447 
   3448 $at_traceoff
   3449 echo "output.at:114: grep 'include .subdir/' subdir/foo.hh"
   3450 echo output.at:114 >$at_check_line_file
   3451 ( $at_traceon; grep 'include .subdir/' subdir/foo.hh ) >$at_stdout 2>$at_stder1
   3452 at_status=$?
   3453 grep '^ *+' $at_stder1 >&2
   3454 grep -v '^ *+' $at_stder1 >$at_stderr
   3455 at_failed=false
   3456 $at_diff $at_devnull $at_stderr || at_failed=:
   3457 $at_diff $at_devnull $at_stdout || at_failed=:
   3458 case $at_status in
   3459    77) echo 77 > $at_status_file
   3460             exit 77;;
   3461    1) ;;
   3462    *) echo "output.at:114: exit code was $at_status, expected 1"
   3463       at_failed=:;;
   3464 esac
   3465 if $at_failed; then
   3466 
   3467   echo 1 > $at_status_file
   3468   exit 1
   3469 fi
   3470 
   3471 $at_traceon
   3472 
   3473 
   3474       $at_traceoff
   3475       $at_times_p && times >$at_times_file
   3476     ) 5>&1 2>&1 | eval $at_tee_pipe
   3477     at_status=`cat $at_status_file`
   3478     ;;
   3479 
   3480 
   3481   banner-3 ) # Banner 3. sets.at:59
   3482     cat <<\_ATEOF
   3483 
   3484 Grammar Sets (Firsts etc.).
   3485 
   3486 _ATEOF
   3487     ;;
   3488 
   3489   31 ) # 31. sets.at:66: Nullable
   3490     at_setup_line='sets.at:66'
   3491     at_desc='Nullable'
   3492     $at_quiet $ECHO_N " 31: Nullable                                     $ECHO_C"
   3493     at_xfail=no
   3494     (
   3495       echo "31. sets.at:66: testing ..."
   3496       $at_traceon
   3497 
   3498 
   3499 # At some point, nullable had been smoking grass, and managed to say:
   3500 #
   3501 # Entering set_nullable
   3502 # NULLABLE
   3503 #         'e': yes
   3504 #         (null): no
   3505 # ...
   3506 
   3507 cat >input.y <<'_ATEOF'
   3508 %%
   3509 e: 'e' | /* Nothing */;
   3510 _ATEOF
   3511 
   3512 
   3513 $at_traceoff
   3514 echo "sets.at:81: bison --trace=sets input.y"
   3515 echo sets.at:81 >$at_check_line_file
   3516 ( $at_traceon; bison --trace=sets input.y ) >$at_stdout 2>$at_stder1
   3517 at_status=$?
   3518 grep '^ *+' $at_stder1 >&2
   3519 grep -v '^ *+' $at_stder1 >$at_stderr
   3520 at_failed=false
   3521 echo stderr:; tee stderr <$at_stderr
   3522 $at_diff $at_devnull $at_stdout || at_failed=:
   3523 case $at_status in
   3524    77) echo 77 > $at_status_file
   3525             exit 77;;
   3526    0) ;;
   3527    *) echo "sets.at:81: exit code was $at_status, expected 0"
   3528       at_failed=:;;
   3529 esac
   3530 if $at_failed; then
   3531 
   3532   echo 1 > $at_status_file
   3533   exit 1
   3534 fi
   3535 
   3536 $at_traceon
   3537 
   3538 cat >extract.sed <<'_ATEOF'
   3539 #n
   3540 /^NULLABLE$/ {
   3541    :null
   3542    p
   3543    n
   3544    /^[	 ]*$/ !b null
   3545 }
   3546 /^FIRSTS$/ {
   3547    :firsts
   3548    p
   3549    n
   3550    /^[	 ]*$/ !b firsts
   3551 }
   3552 /^FDERIVES$/ {
   3553    :fderiv
   3554    p
   3555    n
   3556    /^[	 ]*$/ !b fderiv
   3557 }
   3558 /^DERIVES$/ {
   3559    :deriv
   3560    p
   3561    n
   3562    /^[	 ]*$/ !b deriv
   3563 }
   3564 _ATEOF
   3565 
   3566 $at_traceoff
   3567 echo "sets.at:82: sed -f extract.sed stderr"
   3568 echo sets.at:82 >$at_check_line_file
   3569 ( $at_traceon; sed -f extract.sed stderr ) >$at_stdout 2>$at_stder1
   3570 at_status=$?
   3571 grep '^ *+' $at_stder1 >&2
   3572 grep -v '^ *+' $at_stder1 >$at_stderr
   3573 at_failed=false
   3574 $at_diff $at_devnull $at_stderr || at_failed=:
   3575 echo stdout:; tee stdout <$at_stdout
   3576 case $at_status in
   3577    77) echo 77 > $at_status_file
   3578             exit 77;;
   3579    0) ;;
   3580    *) echo "sets.at:82: exit code was $at_status, expected 0"
   3581       at_failed=:;;
   3582 esac
   3583 if $at_failed; then
   3584 
   3585   echo 1 > $at_status_file
   3586   exit 1
   3587 fi
   3588 
   3589 $at_traceon
   3590 
   3591 $at_traceoff
   3592 echo "sets.at:82: mv stdout sets"
   3593 echo sets.at:82 >$at_check_line_file
   3594 ( $at_traceon; mv stdout sets ) >$at_stdout 2>$at_stder1
   3595 at_status=$?
   3596 grep '^ *+' $at_stder1 >&2
   3597 grep -v '^ *+' $at_stder1 >$at_stderr
   3598 at_failed=false
   3599 $at_diff $at_devnull $at_stderr || at_failed=:
   3600 $at_diff $at_devnull $at_stdout || at_failed=:
   3601 case $at_status in
   3602    77) echo 77 > $at_status_file
   3603             exit 77;;
   3604    0) ;;
   3605    *) echo "sets.at:82: exit code was $at_status, expected 0"
   3606       at_failed=:;;
   3607 esac
   3608 if $at_failed; then
   3609 
   3610   echo 1 > $at_status_file
   3611   exit 1
   3612 fi
   3613 
   3614 $at_traceon
   3615 
   3616 
   3617 $at_traceoff
   3618 echo "sets.at:107: cat sets"
   3619 echo sets.at:107 >$at_check_line_file
   3620 ( $at_traceon; cat sets ) >$at_stdout 2>$at_stder1
   3621 at_status=$?
   3622 grep '^ *+' $at_stder1 >&2
   3623 grep -v '^ *+' $at_stder1 >$at_stderr
   3624 at_failed=false
   3625 $at_diff $at_devnull $at_stderr || at_failed=:
   3626 echo >>$at_stdout; echo "DERIVES
   3627 	\$accept derives
   3628 		  0  e \$end
   3629 	e derives
   3630 		  1  'e'
   3631 		  2  /* empty */
   3632 NULLABLE
   3633 	\$accept: no
   3634 	e: yes
   3635 FIRSTS
   3636 	\$accept firsts
   3637 		\$accept
   3638 		e
   3639 	e firsts
   3640 		e
   3641 FDERIVES
   3642 	\$accept derives
   3643 		  0  e \$end
   3644 		  1  'e'
   3645 		  2  /* empty */
   3646 	e derives
   3647 		  1  'e'
   3648 		  2  /* empty */
   3649 " | $at_diff - $at_stdout || at_failed=:
   3650 case $at_status in
   3651    77) echo 77 > $at_status_file
   3652             exit 77;;
   3653    0) ;;
   3654    *) echo "sets.at:107: exit code was $at_status, expected 0"
   3655       at_failed=:;;
   3656 esac
   3657 if $at_failed; then
   3658 
   3659   echo 1 > $at_status_file
   3660   exit 1
   3661 fi
   3662 
   3663 $at_traceon
   3664 
   3665 
   3666       $at_traceoff
   3667       $at_times_p && times >$at_times_file
   3668     ) 5>&1 2>&1 | eval $at_tee_pipe
   3669     at_status=`cat $at_status_file`
   3670     ;;
   3671 
   3672   32 ) # 32. sets.at:151: Broken Closure
   3673     at_setup_line='sets.at:151'
   3674     at_desc='Broken Closure'
   3675     $at_quiet $ECHO_N " 32: Broken Closure                               $ECHO_C"
   3676     at_xfail=no
   3677     (
   3678       echo "32. sets.at:151: testing ..."
   3679       $at_traceon
   3680 
   3681 
   3682 cat >input.y <<'_ATEOF'
   3683 %%
   3684 a: b;
   3685 b: c;
   3686 c: d;
   3687 d: e;
   3688 e: f;
   3689 f: g;
   3690 g: h;
   3691 h: 'h';
   3692 _ATEOF
   3693 
   3694 
   3695 $at_traceoff
   3696 echo "sets.at:165: bison --trace=sets input.y"
   3697 echo sets.at:165 >$at_check_line_file
   3698 ( $at_traceon; bison --trace=sets input.y ) >$at_stdout 2>$at_stder1
   3699 at_status=$?
   3700 grep '^ *+' $at_stder1 >&2
   3701 grep -v '^ *+' $at_stder1 >$at_stderr
   3702 at_failed=false
   3703 echo stderr:; tee stderr <$at_stderr
   3704 $at_diff $at_devnull $at_stdout || at_failed=:
   3705 case $at_status in
   3706    77) echo 77 > $at_status_file
   3707             exit 77;;
   3708    0) ;;
   3709    *) echo "sets.at:165: exit code was $at_status, expected 0"
   3710       at_failed=:;;
   3711 esac
   3712 if $at_failed; then
   3713 
   3714   echo 1 > $at_status_file
   3715   exit 1
   3716 fi
   3717 
   3718 $at_traceon
   3719 
   3720 
   3721 $at_traceoff
   3722 echo "sets.at:183: sed -n 's/[	 ]*\$//;/^RTC: Firsts Output BEGIN/,/^RTC: Firsts Output END/p' stderr"
   3723 echo sets.at:183 >$at_check_line_file
   3724 ( $at_traceon; sed -n 's/[	 ]*$//;/^RTC: Firsts Output BEGIN/,/^RTC: Firsts Output END/p' stderr ) >$at_stdout 2>$at_stder1
   3725 at_status=$?
   3726 grep '^ *+' $at_stder1 >&2
   3727 grep -v '^ *+' $at_stder1 >$at_stderr
   3728 at_failed=false
   3729 $at_diff $at_devnull $at_stderr || at_failed=:
   3730 echo >>$at_stdout; echo "RTC: Firsts Output BEGIN
   3731 
   3732    012345678
   3733   .---------.
   3734  0|111111111|
   3735  1| 11111111|
   3736  2|  1111111|
   3737  3|   111111|
   3738  4|    11111|
   3739  5|     1111|
   3740  6|      111|
   3741  7|       11|
   3742  8|        1|
   3743   \`---------'
   3744 RTC: Firsts Output END
   3745 " | $at_diff - $at_stdout || at_failed=:
   3746 case $at_status in
   3747    77) echo 77 > $at_status_file
   3748             exit 77;;
   3749    0) ;;
   3750    *) echo "sets.at:183: exit code was $at_status, expected 0"
   3751       at_failed=:;;
   3752 esac
   3753 if $at_failed; then
   3754 
   3755   echo 1 > $at_status_file
   3756   exit 1
   3757 fi
   3758 
   3759 $at_traceon
   3760 
   3761 
   3762       $at_traceoff
   3763       $at_times_p && times >$at_times_file
   3764     ) 5>&1 2>&1 | eval $at_tee_pipe
   3765     at_status=`cat $at_status_file`
   3766     ;;
   3767 
   3768   33 ) # 33. sets.at:193: Firsts
   3769     at_setup_line='sets.at:193'
   3770     at_desc='Firsts'
   3771     $at_quiet $ECHO_N " 33: Firsts                                       $ECHO_C"
   3772     at_xfail=no
   3773     (
   3774       echo "33. sets.at:193: testing ..."
   3775       $at_traceon
   3776 
   3777 
   3778 cat >input.y <<'_ATEOF'
   3779 %nonassoc '<' '>'
   3780 %left '+' '-'
   3781 %right '^' '='
   3782 %%
   3783 exp:
   3784    exp '<' exp
   3785  | exp '>' exp
   3786  | exp '+' exp
   3787  | exp '-' exp
   3788  | exp '^' exp
   3789  | exp '=' exp
   3790  | "exp"
   3791  ;
   3792 _ATEOF
   3793 
   3794 
   3795 $at_traceoff
   3796 echo "sets.at:211: bison --trace=sets input.y"
   3797 echo sets.at:211 >$at_check_line_file
   3798 ( $at_traceon; bison --trace=sets input.y ) >$at_stdout 2>$at_stder1
   3799 at_status=$?
   3800 grep '^ *+' $at_stder1 >&2
   3801 grep -v '^ *+' $at_stder1 >$at_stderr
   3802 at_failed=false
   3803 echo stderr:; tee stderr <$at_stderr
   3804 $at_diff $at_devnull $at_stdout || at_failed=:
   3805 case $at_status in
   3806    77) echo 77 > $at_status_file
   3807             exit 77;;
   3808    0) ;;
   3809    *) echo "sets.at:211: exit code was $at_status, expected 0"
   3810       at_failed=:;;
   3811 esac
   3812 if $at_failed; then
   3813 
   3814   echo 1 > $at_status_file
   3815   exit 1
   3816 fi
   3817 
   3818 $at_traceon
   3819 
   3820 cat >extract.sed <<'_ATEOF'
   3821 #n
   3822 /^NULLABLE$/ {
   3823    :null
   3824    p
   3825    n
   3826    /^[	 ]*$/ !b null
   3827 }
   3828 /^FIRSTS$/ {
   3829    :firsts
   3830    p
   3831    n
   3832    /^[	 ]*$/ !b firsts
   3833 }
   3834 /^FDERIVES$/ {
   3835    :fderiv
   3836    p
   3837    n
   3838    /^[	 ]*$/ !b fderiv
   3839 }
   3840 /^DERIVES$/ {
   3841    :deriv
   3842    p
   3843    n
   3844    /^[	 ]*$/ !b deriv
   3845 }
   3846 _ATEOF
   3847 
   3848 $at_traceoff
   3849 echo "sets.at:212: sed -f extract.sed stderr"
   3850 echo sets.at:212 >$at_check_line_file
   3851 ( $at_traceon; sed -f extract.sed stderr ) >$at_stdout 2>$at_stder1
   3852 at_status=$?
   3853 grep '^ *+' $at_stder1 >&2
   3854 grep -v '^ *+' $at_stder1 >$at_stderr
   3855 at_failed=false
   3856 $at_diff $at_devnull $at_stderr || at_failed=:
   3857 echo stdout:; tee stdout <$at_stdout
   3858 case $at_status in
   3859    77) echo 77 > $at_status_file
   3860             exit 77;;
   3861    0) ;;
   3862    *) echo "sets.at:212: exit code was $at_status, expected 0"
   3863       at_failed=:;;
   3864 esac
   3865 if $at_failed; then
   3866 
   3867   echo 1 > $at_status_file
   3868   exit 1
   3869 fi
   3870 
   3871 $at_traceon
   3872 
   3873 $at_traceoff
   3874 echo "sets.at:212: mv stdout sets"
   3875 echo sets.at:212 >$at_check_line_file
   3876 ( $at_traceon; mv stdout sets ) >$at_stdout 2>$at_stder1
   3877 at_status=$?
   3878 grep '^ *+' $at_stder1 >&2
   3879 grep -v '^ *+' $at_stder1 >$at_stderr
   3880 at_failed=false
   3881 $at_diff $at_devnull $at_stderr || at_failed=:
   3882 $at_diff $at_devnull $at_stdout || at_failed=:
   3883 case $at_status in
   3884    77) echo 77 > $at_status_file
   3885             exit 77;;
   3886    0) ;;
   3887    *) echo "sets.at:212: exit code was $at_status, expected 0"
   3888       at_failed=:;;
   3889 esac
   3890 if $at_failed; then
   3891 
   3892   echo 1 > $at_status_file
   3893   exit 1
   3894 fi
   3895 
   3896 $at_traceon
   3897 
   3898 
   3899 $at_traceoff
   3900 echo "sets.at:252: cat sets"
   3901 echo sets.at:252 >$at_check_line_file
   3902 ( $at_traceon; cat sets ) >$at_stdout 2>$at_stder1
   3903 at_status=$?
   3904 grep '^ *+' $at_stder1 >&2
   3905 grep -v '^ *+' $at_stder1 >$at_stderr
   3906 at_failed=false
   3907 $at_diff $at_devnull $at_stderr || at_failed=:
   3908 echo >>$at_stdout; echo "DERIVES
   3909 	\$accept derives
   3910 		  0  exp \$end
   3911 	exp derives
   3912 		  1  exp '<' exp
   3913 		  2  exp '>' exp
   3914 		  3  exp '+' exp
   3915 		  4  exp '-' exp
   3916 		  5  exp '^' exp
   3917 		  6  exp '=' exp
   3918 		  7  \"exp\"
   3919 NULLABLE
   3920 	\$accept: no
   3921 	exp: no
   3922 FIRSTS
   3923 	\$accept firsts
   3924 		\$accept
   3925 		exp
   3926 	exp firsts
   3927 		exp
   3928 FDERIVES
   3929 	\$accept derives
   3930 		  0  exp \$end
   3931 		  1  exp '<' exp
   3932 		  2  exp '>' exp
   3933 		  3  exp '+' exp
   3934 		  4  exp '-' exp
   3935 		  5  exp '^' exp
   3936 		  6  exp '=' exp
   3937 		  7  \"exp\"
   3938 	exp derives
   3939 		  1  exp '<' exp
   3940 		  2  exp '>' exp
   3941 		  3  exp '+' exp
   3942 		  4  exp '-' exp
   3943 		  5  exp '^' exp
   3944 		  6  exp '=' exp
   3945 		  7  \"exp\"
   3946 " | $at_diff - $at_stdout || at_failed=:
   3947 case $at_status in
   3948    77) echo 77 > $at_status_file
   3949             exit 77;;
   3950    0) ;;
   3951    *) echo "sets.at:252: exit code was $at_status, expected 0"
   3952       at_failed=:;;
   3953 esac
   3954 if $at_failed; then
   3955 
   3956   echo 1 > $at_status_file
   3957   exit 1
   3958 fi
   3959 
   3960 $at_traceon
   3961 
   3962 
   3963       $at_traceoff
   3964       $at_times_p && times >$at_times_file
   3965     ) 5>&1 2>&1 | eval $at_tee_pipe
   3966     at_status=`cat $at_status_file`
   3967     ;;
   3968 
   3969   34 ) # 34. sets.at:269: Accept
   3970     at_setup_line='sets.at:269'
   3971     at_desc='Accept'
   3972     $at_quiet $ECHO_N " 34: Accept                                       $ECHO_C"
   3973     at_xfail=no
   3974     (
   3975       echo "34. sets.at:269: testing ..."
   3976       $at_traceon
   3977 
   3978 
   3979 cat >input.y <<'_ATEOF'
   3980 %token END 0
   3981 %%
   3982 input:
   3983   'a'
   3984 | '(' input ')'
   3985 | '(' error END
   3986 ;
   3987 _ATEOF
   3988 
   3989 
   3990 $at_traceoff
   3991 echo "sets.at:281: bison -v -o input.c input.y"
   3992 echo sets.at:281 >$at_check_line_file
   3993 ( $at_traceon; bison -v -o input.c input.y ) >$at_stdout 2>$at_stder1
   3994 at_status=$?
   3995 grep '^ *+' $at_stder1 >&2
   3996 grep -v '^ *+' $at_stder1 >$at_stderr
   3997 at_failed=false
   3998 $at_diff $at_devnull $at_stderr || at_failed=:
   3999 $at_diff $at_devnull $at_stdout || at_failed=:
   4000 case $at_status in
   4001    77) echo 77 > $at_status_file
   4002             exit 77;;
   4003    0) ;;
   4004    *) echo "sets.at:281: exit code was $at_status, expected 0"
   4005       at_failed=:;;
   4006 esac
   4007 if $at_failed; then
   4008 
   4009   echo 1 > $at_status_file
   4010   exit 1
   4011 fi
   4012 
   4013 $at_traceon
   4014 
   4015 
   4016 # Get the final state in the parser.
   4017 $at_traceoff
   4018 echo "sets.at:285: sed -n 's/.*define YYFINAL *\\([0-9][0-9]*\\)/final state \\1/p' input.c"
   4019 echo sets.at:285 >$at_check_line_file
   4020 ( $at_traceon; sed -n 's/.*define YYFINAL *\([0-9][0-9]*\)/final state \1/p' input.c ) >$at_stdout 2>$at_stder1
   4021 at_status=$?
   4022 grep '^ *+' $at_stder1 >&2
   4023 grep -v '^ *+' $at_stder1 >$at_stderr
   4024 at_failed=false
   4025 $at_diff $at_devnull $at_stderr || at_failed=:
   4026 echo stdout:; tee stdout <$at_stdout
   4027 case $at_status in
   4028    77) echo 77 > $at_status_file
   4029             exit 77;;
   4030    0) ;;
   4031    *) echo "sets.at:285: exit code was $at_status, expected 0"
   4032       at_failed=:;;
   4033 esac
   4034 if $at_failed; then
   4035 
   4036   echo 1 > $at_status_file
   4037   exit 1
   4038 fi
   4039 
   4040 $at_traceon
   4041 
   4042 mv stdout expout
   4043 
   4044 # Get the final state in the report, from the "accept" action..
   4045 $at_traceoff
   4046 echo "sets.at:300: sed -n '
   4047            /^state \\(.*\\)/{
   4048 	     s//final state \\1/
   4049 	     x
   4050 	   }
   4051 	   / accept/{
   4052 	     x
   4053 	     p
   4054 	     q
   4055 	   }
   4056 	' input.output"
   4057 echo sets.at:300 >$at_check_line_file
   4058 ( $at_traceon; sed -n '
   4059            /^state \(.*\)/{
   4060 	     s//final state \1/
   4061 	     x
   4062 	   }
   4063 	   / accept/{
   4064 	     x
   4065 	     p
   4066 	     q
   4067 	   }
   4068 	' input.output ) >$at_stdout 2>$at_stder1
   4069 at_status=$?
   4070 grep '^ *+' $at_stder1 >&2
   4071 grep -v '^ *+' $at_stder1 >$at_stderr
   4072 at_failed=false
   4073 $at_diff $at_devnull $at_stderr || at_failed=:
   4074 $at_diff expout $at_stdout || at_failed=:
   4075 case $at_status in
   4076    77) echo 77 > $at_status_file
   4077             exit 77;;
   4078    0) ;;
   4079    *) echo "sets.at:300: exit code was $at_status, expected 0"
   4080       at_failed=:;;
   4081 esac
   4082 if $at_failed; then
   4083 
   4084   echo 1 > $at_status_file
   4085   exit 1
   4086 fi
   4087 
   4088 $at_traceon
   4089 
   4090 
   4091       $at_traceoff
   4092       $at_times_p && times >$at_times_file
   4093     ) 5>&1 2>&1 | eval $at_tee_pipe
   4094     at_status=`cat $at_status_file`
   4095     ;;
   4096 
   4097 
   4098   banner-4 ) # Banner 4. reduce.at:19
   4099     cat <<\_ATEOF
   4100 
   4101 Grammar Reduction.
   4102 
   4103 _ATEOF
   4104     ;;
   4105 
   4106   35 ) # 35. reduce.at:26: Useless Terminals
   4107     at_setup_line='reduce.at:26'
   4108     at_desc='Useless Terminals'
   4109     $at_quiet $ECHO_N " 35: Useless Terminals                            $ECHO_C"
   4110     at_xfail=no
   4111     (
   4112       echo "35. reduce.at:26: testing ..."
   4113       $at_traceon
   4114 
   4115 
   4116 cat >input.y <<'_ATEOF'
   4117 %verbose
   4118 %output="input.c"
   4119 
   4120 %token useless1
   4121 %token useless2
   4122 %token useless3
   4123 %token useless4
   4124 %token useless5
   4125 %token useless6
   4126 %token useless7
   4127 %token useless8
   4128 %token useless9
   4129 
   4130 %token useful
   4131 %%
   4132 exp: useful;
   4133 _ATEOF
   4134 
   4135 
   4136 $at_traceoff
   4137 echo "reduce.at:47: bison input.y"
   4138 echo reduce.at:47 >$at_check_line_file
   4139 ( $at_traceon; bison input.y ) >$at_stdout 2>$at_stder1
   4140 at_status=$?
   4141 grep '^ *+' $at_stder1 >&2
   4142 grep -v '^ *+' $at_stder1 >$at_stderr
   4143 at_failed=false
   4144 $at_diff $at_devnull $at_stderr || at_failed=:
   4145 $at_diff $at_devnull $at_stdout || at_failed=:
   4146 case $at_status in
   4147    77) echo 77 > $at_status_file
   4148             exit 77;;
   4149    0) ;;
   4150    *) echo "reduce.at:47: exit code was $at_status, expected 0"
   4151       at_failed=:;;
   4152 esac
   4153 if $at_failed; then
   4154 
   4155   echo 1 > $at_status_file
   4156   exit 1
   4157 fi
   4158 
   4159 $at_traceon
   4160 
   4161 
   4162 $at_traceoff
   4163 echo "reduce.at:60: sed -n '/^Grammar/q;/^\$/!p' input.output"
   4164 echo reduce.at:60 >$at_check_line_file
   4165 ( $at_traceon; sed -n '/^Grammar/q;/^$/!p' input.output ) >$at_stdout 2>$at_stder1
   4166 at_status=$?
   4167 grep '^ *+' $at_stder1 >&2
   4168 grep -v '^ *+' $at_stder1 >$at_stderr
   4169 at_failed=false
   4170 $at_diff $at_devnull $at_stderr || at_failed=:
   4171 echo >>$at_stdout; echo "Terminals which are not used
   4172    useless1
   4173    useless2
   4174    useless3
   4175    useless4
   4176    useless5
   4177    useless6
   4178    useless7
   4179    useless8
   4180    useless9
   4181 " | $at_diff - $at_stdout || at_failed=:
   4182 case $at_status in
   4183    77) echo 77 > $at_status_file
   4184             exit 77;;
   4185    0) ;;
   4186    *) echo "reduce.at:60: exit code was $at_status, expected 0"
   4187       at_failed=:;;
   4188 esac
   4189 if $at_failed; then
   4190 
   4191   echo 1 > $at_status_file
   4192   exit 1
   4193 fi
   4194 
   4195 $at_traceon
   4196 
   4197 
   4198       $at_traceoff
   4199       $at_times_p && times >$at_times_file
   4200     ) 5>&1 2>&1 | eval $at_tee_pipe
   4201     at_status=`cat $at_status_file`
   4202     ;;
   4203 
   4204   36 ) # 36. reduce.at:70: Useless Nonterminals
   4205     at_setup_line='reduce.at:70'
   4206     at_desc='Useless Nonterminals'
   4207     $at_quiet $ECHO_N " 36: Useless Nonterminals                         $ECHO_C"
   4208     at_xfail=no
   4209     (
   4210       echo "36. reduce.at:70: testing ..."
   4211       $at_traceon
   4212 
   4213 
   4214 cat >input.y <<'_ATEOF'
   4215 %verbose
   4216 %output="input.c"
   4217 
   4218 %nterm useless1
   4219 %nterm useless2
   4220 %nterm useless3
   4221 %nterm useless4
   4222 %nterm useless5
   4223 %nterm useless6
   4224 %nterm useless7
   4225 %nterm useless8
   4226 %nterm useless9
   4227 
   4228 %token useful
   4229 %%
   4230 exp: useful;
   4231 _ATEOF
   4232 
   4233 
   4234 $at_traceoff
   4235 echo "reduce.at:102: bison input.y"
   4236 echo reduce.at:102 >$at_check_line_file
   4237 ( $at_traceon; bison input.y ) >$at_stdout 2>$at_stder1
   4238 at_status=$?
   4239 grep '^ *+' $at_stder1 >&2
   4240 grep -v '^ *+' $at_stder1 >$at_stderr
   4241 at_failed=false
   4242 echo >>$at_stderr; echo "input.y: warning: 9 useless nonterminals
   4243 input.y:4.8-15: warning: useless nonterminal: useless1
   4244 input.y:5.8-15: warning: useless nonterminal: useless2
   4245 input.y:6.8-15: warning: useless nonterminal: useless3
   4246 input.y:7.8-15: warning: useless nonterminal: useless4
   4247 input.y:8.8-15: warning: useless nonterminal: useless5
   4248 input.y:9.8-15: warning: useless nonterminal: useless6
   4249 input.y:10.8-15: warning: useless nonterminal: useless7
   4250 input.y:11.8-15: warning: useless nonterminal: useless8
   4251 input.y:12.8-15: warning: useless nonterminal: useless9
   4252 " | $at_diff - $at_stderr || at_failed=:
   4253 $at_diff $at_devnull $at_stdout || at_failed=:
   4254 case $at_status in
   4255    77) echo 77 > $at_status_file
   4256             exit 77;;
   4257    0) ;;
   4258    *) echo "reduce.at:102: exit code was $at_status, expected 0"
   4259       at_failed=:;;
   4260 esac
   4261 if $at_failed; then
   4262 
   4263   echo 1 > $at_status_file
   4264   exit 1
   4265 fi
   4266 
   4267 $at_traceon
   4268 
   4269 
   4270 $at_traceoff
   4271 echo "reduce.at:115: sed -n '/^Grammar/q;/^\$/!p' input.output"
   4272 echo reduce.at:115 >$at_check_line_file
   4273 ( $at_traceon; sed -n '/^Grammar/q;/^$/!p' input.output ) >$at_stdout 2>$at_stder1
   4274 at_status=$?
   4275 grep '^ *+' $at_stder1 >&2
   4276 grep -v '^ *+' $at_stder1 >$at_stderr
   4277 at_failed=false
   4278 $at_diff $at_devnull $at_stderr || at_failed=:
   4279 echo >>$at_stdout; echo "Useless nonterminals
   4280    useless1
   4281    useless2
   4282    useless3
   4283    useless4
   4284    useless5
   4285    useless6
   4286    useless7
   4287    useless8
   4288    useless9
   4289 " | $at_diff - $at_stdout || at_failed=:
   4290 case $at_status in
   4291    77) echo 77 > $at_status_file
   4292             exit 77;;
   4293    0) ;;
   4294    *) echo "reduce.at:115: exit code was $at_status, expected 0"
   4295       at_failed=:;;
   4296 esac
   4297 if $at_failed; then
   4298 
   4299   echo 1 > $at_status_file
   4300   exit 1
   4301 fi
   4302 
   4303 $at_traceon
   4304 
   4305 
   4306       $at_traceoff
   4307       $at_times_p && times >$at_times_file
   4308     ) 5>&1 2>&1 | eval $at_tee_pipe
   4309     at_status=`cat $at_status_file`
   4310     ;;
   4311 
   4312   37 ) # 37. reduce.at:125: Useless Rules
   4313     at_setup_line='reduce.at:125'
   4314     at_desc='Useless Rules'
   4315     $at_quiet $ECHO_N " 37: Useless Rules                                $ECHO_C"
   4316     at_xfail=no
   4317     (
   4318       echo "37. reduce.at:125: testing ..."
   4319       $at_traceon
   4320 
   4321 
   4322 
   4323 
   4324 cat >input.y <<'_ATEOF'
   4325 %verbose
   4326 %output="input.c"
   4327 %token useful
   4328 %%
   4329 exp: useful;
   4330 useless1: '1';
   4331 useless2: '2';
   4332 useless3: '3';
   4333 useless4: '4';
   4334 useless5: '5';
   4335 useless6: '6';
   4336 useless7: '7';
   4337 useless8: '8';
   4338 useless9: '9';
   4339 _ATEOF
   4340 
   4341 
   4342 $at_traceoff
   4343 echo "reduce.at:166: bison input.y"
   4344 echo reduce.at:166 >$at_check_line_file
   4345 ( $at_traceon; bison input.y ) >$at_stdout 2>$at_stder1
   4346 at_status=$?
   4347 grep '^ *+' $at_stder1 >&2
   4348 grep -v '^ *+' $at_stder1 >$at_stderr
   4349 at_failed=false
   4350 echo >>$at_stderr; echo "input.y: warning: 9 useless nonterminals and 9 useless rules
   4351 input.y:6.1-8: warning: useless nonterminal: useless1
   4352 input.y:7.1-8: warning: useless nonterminal: useless2
   4353 input.y:8.1-8: warning: useless nonterminal: useless3
   4354 input.y:9.1-8: warning: useless nonterminal: useless4
   4355 input.y:10.1-8: warning: useless nonterminal: useless5
   4356 input.y:11.1-8: warning: useless nonterminal: useless6
   4357 input.y:12.1-8: warning: useless nonterminal: useless7
   4358 input.y:13.1-8: warning: useless nonterminal: useless8
   4359 input.y:14.1-8: warning: useless nonterminal: useless9
   4360 input.y:6.11-13: warning: useless rule: useless1: '1'
   4361 input.y:7.11-13: warning: useless rule: useless2: '2'
   4362 input.y:8.11-13: warning: useless rule: useless3: '3'
   4363 input.y:9.11-13: warning: useless rule: useless4: '4'
   4364 input.y:10.11-13: warning: useless rule: useless5: '5'
   4365 input.y:11.11-13: warning: useless rule: useless6: '6'
   4366 input.y:12.11-13: warning: useless rule: useless7: '7'
   4367 input.y:13.11-13: warning: useless rule: useless8: '8'
   4368 input.y:14.11-13: warning: useless rule: useless9: '9'
   4369 " | $at_diff - $at_stderr || at_failed=:
   4370 $at_diff $at_devnull $at_stdout || at_failed=:
   4371 case $at_status in
   4372    77) echo 77 > $at_status_file
   4373             exit 77;;
   4374    0) ;;
   4375    *) echo "reduce.at:166: exit code was $at_status, expected 0"
   4376       at_failed=:;;
   4377 esac
   4378 if $at_failed; then
   4379 
   4380   echo 1 > $at_status_file
   4381   exit 1
   4382 fi
   4383 
   4384 $at_traceon
   4385 
   4386 
   4387 $at_traceoff
   4388 echo "reduce.at:199: sed -n '/^Grammar/q;/^\$/!p' input.output"
   4389 echo reduce.at:199 >$at_check_line_file
   4390 ( $at_traceon; sed -n '/^Grammar/q;/^$/!p' input.output ) >$at_stdout 2>$at_stder1
   4391 at_status=$?
   4392 grep '^ *+' $at_stder1 >&2
   4393 grep -v '^ *+' $at_stder1 >$at_stderr
   4394 at_failed=false
   4395 $at_diff $at_devnull $at_stderr || at_failed=:
   4396 echo >>$at_stdout; echo "Useless nonterminals
   4397    useless1
   4398    useless2
   4399    useless3
   4400    useless4
   4401    useless5
   4402    useless6
   4403    useless7
   4404    useless8
   4405    useless9
   4406 Terminals which are not used
   4407    '1'
   4408    '2'
   4409    '3'
   4410    '4'
   4411    '5'
   4412    '6'
   4413    '7'
   4414    '8'
   4415    '9'
   4416 Useless rules
   4417     2 useless1: '1'
   4418     3 useless2: '2'
   4419     4 useless3: '3'
   4420     5 useless4: '4'
   4421     6 useless5: '5'
   4422     7 useless6: '6'
   4423     8 useless7: '7'
   4424     9 useless8: '8'
   4425    10 useless9: '9'
   4426 " | $at_diff - $at_stdout || at_failed=:
   4427 case $at_status in
   4428    77) echo 77 > $at_status_file
   4429             exit 77;;
   4430    0) ;;
   4431    *) echo "reduce.at:199: exit code was $at_status, expected 0"
   4432       at_failed=:;;
   4433 esac
   4434 if $at_failed; then
   4435 
   4436   echo 1 > $at_status_file
   4437   exit 1
   4438 fi
   4439 
   4440 $at_traceon
   4441 
   4442 
   4443       $at_traceoff
   4444       $at_times_p && times >$at_times_file
   4445     ) 5>&1 2>&1 | eval $at_tee_pipe
   4446     at_status=`cat $at_status_file`
   4447     ;;
   4448 
   4449   38 ) # 38. reduce.at:212: Reduced Automaton
   4450     at_setup_line='reduce.at:212'
   4451     at_desc='Reduced Automaton'
   4452     $at_quiet $ECHO_N " 38: Reduced Automaton                            $ECHO_C"
   4453     at_xfail=no
   4454     (
   4455       echo "38. reduce.at:212: testing ..."
   4456       $at_traceon
   4457 
   4458 
   4459 
   4460 
   4461 # The non reduced grammar.
   4462 # ------------------------
   4463 cat >not-reduced.y <<'_ATEOF'
   4464 /* A useless token. */
   4465 %token useless_token
   4466 /* A useful one. */
   4467 %token useful
   4468 %verbose
   4469 %output="not-reduced.c"
   4470 
   4471 %%
   4472 
   4473 exp: useful            { /* A useful action. */ }
   4474    | non_productive    { /* A non productive action. */ }
   4475    ;
   4476 
   4477 not_reachable: useful  { /* A not reachable action. */ }
   4478              ;
   4479 
   4480 non_productive: non_productive useless_token
   4481                        { /* Another non productive action. */ }
   4482               ;
   4483 %%
   4484 _ATEOF
   4485 
   4486 
   4487 $at_traceoff
   4488 echo "reduce.at:248: bison not-reduced.y"
   4489 echo reduce.at:248 >$at_check_line_file
   4490 ( $at_traceon; bison not-reduced.y ) >$at_stdout 2>$at_stder1
   4491 at_status=$?
   4492 grep '^ *+' $at_stder1 >&2
   4493 grep -v '^ *+' $at_stder1 >$at_stderr
   4494 at_failed=false
   4495 echo >>$at_stderr; echo "not-reduced.y: warning: 2 useless nonterminals and 3 useless rules
   4496 not-reduced.y:14.1-13: warning: useless nonterminal: not_reachable
   4497 not-reduced.y:11.6-19: warning: useless nonterminal: non_productive
   4498 not-reduced.y:11.6-57: warning: useless rule: exp: non_productive
   4499 not-reduced.y:14.16-56: warning: useless rule: not_reachable: useful
   4500 not-reduced.y:17.17-18.63: warning: useless rule: non_productive: non_productive useless_token
   4501 " | $at_diff - $at_stderr || at_failed=:
   4502 $at_diff $at_devnull $at_stdout || at_failed=:
   4503 case $at_status in
   4504    77) echo 77 > $at_status_file
   4505             exit 77;;
   4506    0) ;;
   4507    *) echo "reduce.at:248: exit code was $at_status, expected 0"
   4508       at_failed=:;;
   4509 esac
   4510 if $at_failed; then
   4511 
   4512   echo 1 > $at_status_file
   4513   exit 1
   4514 fi
   4515 
   4516 $at_traceon
   4517 
   4518 
   4519 $at_traceoff
   4520 echo "reduce.at:260: sed -n '/^Grammar/q;/^\$/!p' not-reduced.output"
   4521 echo reduce.at:260 >$at_check_line_file
   4522 ( $at_traceon; sed -n '/^Grammar/q;/^$/!p' not-reduced.output ) >$at_stdout 2>$at_stder1
   4523 at_status=$?
   4524 grep '^ *+' $at_stder1 >&2
   4525 grep -v '^ *+' $at_stder1 >$at_stderr
   4526 at_failed=false
   4527 $at_diff $at_devnull $at_stderr || at_failed=:
   4528 echo >>$at_stdout; echo "Useless nonterminals
   4529    not_reachable
   4530    non_productive
   4531 Terminals which are not used
   4532    useless_token
   4533 Useless rules
   4534     2 exp: non_productive
   4535     3 not_reachable: useful
   4536     4 non_productive: non_productive useless_token
   4537 " | $at_diff - $at_stdout || at_failed=:
   4538 case $at_status in
   4539    77) echo 77 > $at_status_file
   4540             exit 77;;
   4541    0) ;;
   4542    *) echo "reduce.at:260: exit code was $at_status, expected 0"
   4543       at_failed=:;;
   4544 esac
   4545 if $at_failed; then
   4546 
   4547   echo 1 > $at_status_file
   4548   exit 1
   4549 fi
   4550 
   4551 $at_traceon
   4552 
   4553 
   4554 # The reduced grammar.
   4555 # --------------------
   4556 cat >reduced.y <<'_ATEOF'
   4557 /* A useless token. */
   4558 %token useless_token
   4559 /* A useful one. */
   4560 %token useful
   4561 %verbose
   4562 %output="reduced.c"
   4563 
   4564 %%
   4565 
   4566 exp: useful            { /* A useful action. */ }
   4567 //   | non_productive    { /* A non productive action. */ } */
   4568    ;
   4569 
   4570 //not_reachable: useful  { /* A not reachable action. */ }
   4571 //             ;
   4572 
   4573 //non_productive: non_productive useless_token
   4574 //                       { /* Another non productive action. */ }
   4575 //              ;
   4576 %%
   4577 _ATEOF
   4578 
   4579 
   4580 $at_traceoff
   4581 echo "reduce.at:287: bison reduced.y"
   4582 echo reduce.at:287 >$at_check_line_file
   4583 ( $at_traceon; bison reduced.y ) >$at_stdout 2>$at_stder1
   4584 at_status=$?
   4585 grep '^ *+' $at_stder1 >&2
   4586 grep -v '^ *+' $at_stder1 >$at_stderr
   4587 at_failed=false
   4588 $at_diff $at_devnull $at_stderr || at_failed=:
   4589 $at_diff $at_devnull $at_stdout || at_failed=:
   4590 case $at_status in
   4591    77) echo 77 > $at_status_file
   4592             exit 77;;
   4593    0) ;;
   4594    *) echo "reduce.at:287: exit code was $at_status, expected 0"
   4595       at_failed=:;;
   4596 esac
   4597 if $at_failed; then
   4598 
   4599   echo 1 > $at_status_file
   4600   exit 1
   4601 fi
   4602 
   4603 $at_traceon
   4604 
   4605 
   4606 # Comparing the parsers.
   4607 cp reduced.c expout
   4608 $at_traceoff
   4609 echo "reduce.at:291: sed 's/not-reduced/reduced/g' not-reduced.c"
   4610 echo reduce.at:291 >$at_check_line_file
   4611 ( $at_traceon; sed 's/not-reduced/reduced/g' not-reduced.c ) >$at_stdout 2>$at_stder1
   4612 at_status=$?
   4613 grep '^ *+' $at_stder1 >&2
   4614 grep -v '^ *+' $at_stder1 >$at_stderr
   4615 at_failed=false
   4616 $at_diff $at_devnull $at_stderr || at_failed=:
   4617 $at_diff expout $at_stdout || at_failed=:
   4618 case $at_status in
   4619    77) echo 77 > $at_status_file
   4620             exit 77;;
   4621    0) ;;
   4622    *) echo "reduce.at:291: exit code was $at_status, expected 0"
   4623       at_failed=:;;
   4624 esac
   4625 if $at_failed; then
   4626 
   4627   echo 1 > $at_status_file
   4628   exit 1
   4629 fi
   4630 
   4631 $at_traceon
   4632 
   4633 
   4634       $at_traceoff
   4635       $at_times_p && times >$at_times_file
   4636     ) 5>&1 2>&1 | eval $at_tee_pipe
   4637     at_status=`cat $at_status_file`
   4638     ;;
   4639 
   4640   39 ) # 39. reduce.at:301: Underivable Rules
   4641     at_setup_line='reduce.at:301'
   4642     at_desc='Underivable Rules'
   4643     $at_quiet $ECHO_N " 39: Underivable Rules                            $ECHO_C"
   4644     at_xfail=no
   4645     (
   4646       echo "39. reduce.at:301: testing ..."
   4647       $at_traceon
   4648 
   4649 
   4650 
   4651 
   4652 cat >input.y <<'_ATEOF'
   4653 %verbose
   4654 %output="input.c"
   4655 %token useful
   4656 %%
   4657 exp: useful | underivable;
   4658 underivable: indirection;
   4659 indirection: underivable;
   4660 _ATEOF
   4661 
   4662 
   4663 $at_traceoff
   4664 echo "reduce.at:322: bison input.y"
   4665 echo reduce.at:322 >$at_check_line_file
   4666 ( $at_traceon; bison input.y ) >$at_stdout 2>$at_stder1
   4667 at_status=$?
   4668 grep '^ *+' $at_stder1 >&2
   4669 grep -v '^ *+' $at_stder1 >$at_stderr
   4670 at_failed=false
   4671 echo >>$at_stderr; echo "input.y: warning: 2 useless nonterminals and 3 useless rules
   4672 input.y:5.15-25: warning: useless nonterminal: underivable
   4673 input.y:6.14-24: warning: useless nonterminal: indirection
   4674 input.y:5.15-25: warning: useless rule: exp: underivable
   4675 input.y:6.14-24: warning: useless rule: underivable: indirection
   4676 input.y:7.14-24: warning: useless rule: indirection: underivable
   4677 " | $at_diff - $at_stderr || at_failed=:
   4678 $at_diff $at_devnull $at_stdout || at_failed=:
   4679 case $at_status in
   4680    77) echo 77 > $at_status_file
   4681             exit 77;;
   4682    0) ;;
   4683    *) echo "reduce.at:322: exit code was $at_status, expected 0"
   4684       at_failed=:;;
   4685 esac
   4686 if $at_failed; then
   4687 
   4688   echo 1 > $at_status_file
   4689   exit 1
   4690 fi
   4691 
   4692 $at_traceon
   4693 
   4694 
   4695 $at_traceoff
   4696 echo "reduce.at:332: sed -n '/^Grammar/q;/^\$/!p' input.output"
   4697 echo reduce.at:332 >$at_check_line_file
   4698 ( $at_traceon; sed -n '/^Grammar/q;/^$/!p' input.output ) >$at_stdout 2>$at_stder1
   4699 at_status=$?
   4700 grep '^ *+' $at_stder1 >&2
   4701 grep -v '^ *+' $at_stder1 >$at_stderr
   4702 at_failed=false
   4703 $at_diff $at_devnull $at_stderr || at_failed=:
   4704 echo >>$at_stdout; echo "Useless nonterminals
   4705    underivable
   4706    indirection
   4707 Useless rules
   4708     2 exp: underivable
   4709     3 underivable: indirection
   4710     4 indirection: underivable
   4711 " | $at_diff - $at_stdout || at_failed=:
   4712 case $at_status in
   4713    77) echo 77 > $at_status_file
   4714             exit 77;;
   4715    0) ;;
   4716    *) echo "reduce.at:332: exit code was $at_status, expected 0"
   4717       at_failed=:;;
   4718 esac
   4719 if $at_failed; then
   4720 
   4721   echo 1 > $at_status_file
   4722   exit 1
   4723 fi
   4724 
   4725 $at_traceon
   4726 
   4727 
   4728       $at_traceoff
   4729       $at_times_p && times >$at_times_file
   4730     ) 5>&1 2>&1 | eval $at_tee_pipe
   4731     at_status=`cat $at_status_file`
   4732     ;;
   4733 
   4734   40 ) # 40. reduce.at:342: Empty Language
   4735     at_setup_line='reduce.at:342'
   4736     at_desc='Empty Language'
   4737     $at_quiet $ECHO_N " 40: Empty Language                               $ECHO_C"
   4738     at_xfail=no
   4739     (
   4740       echo "40. reduce.at:342: testing ..."
   4741       $at_traceon
   4742 
   4743 
   4744 cat >input.y <<'_ATEOF'
   4745 %output="input.c"
   4746 %%
   4747 exp: exp;
   4748 _ATEOF
   4749 
   4750 
   4751 $at_traceoff
   4752 echo "reduce.at:353: bison input.y"
   4753 echo reduce.at:353 >$at_check_line_file
   4754 ( $at_traceon; bison input.y ) >$at_stdout 2>$at_stder1
   4755 at_status=$?
   4756 grep '^ *+' $at_stder1 >&2
   4757 grep -v '^ *+' $at_stder1 >$at_stderr
   4758 at_failed=false
   4759 echo >>$at_stderr; echo "input.y: warning: 2 useless nonterminals and 2 useless rules
   4760 input.y:3.1-3: fatal error: start symbol exp does not derive any sentence
   4761 " | $at_diff - $at_stderr || at_failed=:
   4762 $at_diff $at_devnull $at_stdout || at_failed=:
   4763 case $at_status in
   4764    77) echo 77 > $at_status_file
   4765             exit 77;;
   4766    1) ;;
   4767    *) echo "reduce.at:353: exit code was $at_status, expected 1"
   4768       at_failed=:;;
   4769 esac
   4770 if $at_failed; then
   4771 
   4772   echo 1 > $at_status_file
   4773   exit 1
   4774 fi
   4775 
   4776 $at_traceon
   4777 
   4778 
   4779       $at_traceoff
   4780       $at_times_p && times >$at_times_file
   4781     ) 5>&1 2>&1 | eval $at_tee_pipe
   4782     at_status=`cat $at_status_file`
   4783     ;;
   4784 
   4785 
   4786   banner-5 ) # Banner 5. synclines.at:19
   4787     cat <<\_ATEOF
   4788 
   4789 User Actions.
   4790 
   4791 _ATEOF
   4792     ;;
   4793 
   4794   41 ) # 41. synclines.at:95: Prologue synch line
   4795     at_setup_line='synclines.at:95'
   4796     at_desc='Prologue synch line'
   4797     $at_quiet $ECHO_N " 41: Prologue synch line                          $ECHO_C"
   4798     at_xfail=no
   4799     (
   4800       echo "41. synclines.at:95: testing ..."
   4801       $at_traceon
   4802 
   4803 
   4804 # It seems impossible to find a generic scheme to check the location
   4805 # of an error.  Even requiring GCC is not sufficient, since for instance
   4806 # the version modified by Apple:
   4807 #
   4808 # | Reading specs from /usr/libexec/gcc/darwin/ppc/2.95.2/specs
   4809 # | Apple Computer, Inc. version gcc-934.3, based on gcc version 2.95.2
   4810 # | 19991024 (release) configure:2124: $? = 0
   4811 #
   4812 # instead of:
   4813 #
   4814 # | input.y:2: #error "2"
   4815 #
   4816 # it reports:
   4817 #
   4818 # | input.y:2: "2"
   4819 # | cpp-precomp: warning: errors during smart preprocessing, retrying in basic mode
   4820 
   4821 cat >syncline.c <<'_ATEOF'
   4822 #error "1"
   4823 _ATEOF
   4824 
   4825 
   4826 $at_traceoff
   4827 echo "synclines.at:95: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c"
   4828 echo synclines.at:95 >$at_check_line_file
   4829 ( $at_traceon; $CC $CFLAGS $CPPFLAGS -c syncline.c ) >$at_stdout 2>$at_stder1
   4830 at_status=$?
   4831 grep '^ *+' $at_stder1 >&2
   4832 grep -v '^ *+' $at_stder1 >$at_stderr
   4833 at_failed=false
   4834 echo stderr:; tee stderr <$at_stderr
   4835 $at_diff $at_devnull $at_stdout || at_failed=:
   4836 case $at_status in
   4837    77) echo 77 > $at_status_file
   4838             exit 77;;
   4839    *);;
   4840 esac
   4841 if $at_failed; then
   4842 
   4843   echo 1 > $at_status_file
   4844   exit 1
   4845 fi
   4846 
   4847 $at_traceon
   4848 
   4849 # In case GCC displays column information, strip it down.
   4850 #
   4851 #   input.y:4:2: #error "4"    or
   4852 #   input.y:4.2: #error "4"    or
   4853 #   input.y:4:2: error: #error "4"
   4854 # =>
   4855 #   input.y:4: #error "4"
   4856 #
   4857 $at_traceoff
   4858 echo "synclines.at:95: sed -e 's/^\\([^:]*:[^:.]*\\)[.:][^:]*:\\(.*\\)\$/\\1:\\2/' -e 's/^\\([^:]*:[^:]*:\\)[^#]*\\( #error\\)/\\1\\2/' stderr"
   4859 echo synclines.at:95 >$at_check_line_file
   4860 ( $at_traceon; sed -e 's/^\([^:]*:[^:.]*\)[.:][^:]*:\(.*\)$/\1:\2/' -e 's/^\([^:]*:[^:]*:\)[^#]*\( #error\)/\1\2/' stderr ) >$at_stdout 2>$at_stder1
   4861 at_status=$?
   4862 grep '^ *+' $at_stder1 >&2
   4863 grep -v '^ *+' $at_stder1 >$at_stderr
   4864 at_failed=false
   4865 $at_diff $at_devnull $at_stderr || at_failed=:
   4866 echo stdout:; tee stdout <$at_stdout
   4867 case $at_status in
   4868    77) echo 77 > $at_status_file
   4869             exit 77;;
   4870    0) ;;
   4871    *) echo "synclines.at:95: exit code was $at_status, expected 0"
   4872       at_failed=:;;
   4873 esac
   4874 if $at_failed; then
   4875 
   4876   echo 1 > $at_status_file
   4877   exit 1
   4878 fi
   4879 
   4880 $at_traceon
   4881 
   4882 
   4883 $at_traceoff
   4884 echo "synclines.at:95: test \"\`cat stdout\`\" = 'syncline.c:1: #error \"1\"' || exit 77"
   4885 echo synclines.at:95 >$at_check_line_file
   4886 ( $at_traceon; test "`cat stdout`" = 'syncline.c:1: #error "1"' || exit 77 ) >$at_stdout 2>$at_stder1
   4887 at_status=$?
   4888 grep '^ *+' $at_stder1 >&2
   4889 grep -v '^ *+' $at_stder1 >$at_stderr
   4890 at_failed=false
   4891 $at_diff $at_devnull $at_stderr || at_failed=:
   4892 $at_diff $at_devnull $at_stdout || at_failed=:
   4893 case $at_status in
   4894    77) echo 77 > $at_status_file
   4895             exit 77;;
   4896    0) ;;
   4897    *) echo "synclines.at:95: exit code was $at_status, expected 0"
   4898       at_failed=:;;
   4899 esac
   4900 if $at_failed; then
   4901 
   4902   echo 1 > $at_status_file
   4903   exit 1
   4904 fi
   4905 
   4906 $at_traceon
   4907 
   4908 
   4909 cat >input.y <<'_ATEOF'
   4910 %{
   4911 #error "2"
   4912 void yyerror (const char *s);
   4913 int yylex (void);
   4914 %}
   4915 %%
   4916 exp: '0';
   4917 _ATEOF
   4918 
   4919 $at_traceoff
   4920 echo "synclines.at:95: bison -o input.c input.y"
   4921 echo synclines.at:95 >$at_check_line_file
   4922 ( $at_traceon; bison -o input.c input.y ) >$at_stdout 2>$at_stder1
   4923 at_status=$?
   4924 grep '^ *+' $at_stder1 >&2
   4925 grep -v '^ *+' $at_stder1 >$at_stderr
   4926 at_failed=false
   4927 $at_diff $at_devnull $at_stderr || at_failed=:
   4928 $at_diff $at_devnull $at_stdout || at_failed=:
   4929 case $at_status in
   4930    77) echo 77 > $at_status_file
   4931             exit 77;;
   4932    0) ;;
   4933    *) echo "synclines.at:95: exit code was $at_status, expected 0"
   4934       at_failed=:;;
   4935 esac
   4936 if $at_failed; then
   4937 
   4938   echo 1 > $at_status_file
   4939   exit 1
   4940 fi
   4941 
   4942 $at_traceon
   4943 
   4944 $at_traceoff
   4945 echo "synclines.at:95: \$CC \$CFLAGS \$CPPFLAGS -c input.c"
   4946 echo synclines.at:95 >$at_check_line_file
   4947 ( $at_traceon; $CC $CFLAGS $CPPFLAGS -c input.c ) >$at_stdout 2>$at_stder1
   4948 at_status=$?
   4949 grep '^ *+' $at_stder1 >&2
   4950 grep -v '^ *+' $at_stder1 >$at_stderr
   4951 at_failed=false
   4952 echo stderr:; tee stderr <$at_stderr
   4953 $at_diff $at_devnull $at_stdout || at_failed=:
   4954 case $at_status in
   4955    77) echo 77 > $at_status_file
   4956             exit 77;;
   4957    *);;
   4958 esac
   4959 if $at_failed; then
   4960 
   4961   echo 1 > $at_status_file
   4962   exit 1
   4963 fi
   4964 
   4965 $at_traceon
   4966 
   4967 # In case GCC displays column information, strip it down.
   4968 #
   4969 #   input.y:4:2: #error "4"    or
   4970 #   input.y:4.2: #error "4"    or
   4971 #   input.y:4:2: error: #error "4"
   4972 # =>
   4973 #   input.y:4: #error "4"
   4974 #
   4975 $at_traceoff
   4976 echo "synclines.at:95: sed -e 's/^\\([^:]*:[^:.]*\\)[.:][^:]*:\\(.*\\)\$/\\1:\\2/' -e 's/^\\([^:]*:[^:]*:\\)[^#]*\\( #error\\)/\\1\\2/' stderr"
   4977 echo synclines.at:95 >$at_check_line_file
   4978 ( $at_traceon; sed -e 's/^\([^:]*:[^:.]*\)[.:][^:]*:\(.*\)$/\1:\2/' -e 's/^\([^:]*:[^:]*:\)[^#]*\( #error\)/\1\2/' stderr ) >$at_stdout 2>$at_stder1
   4979 at_status=$?
   4980 grep '^ *+' $at_stder1 >&2
   4981 grep -v '^ *+' $at_stder1 >$at_stderr
   4982 at_failed=false
   4983 $at_diff $at_devnull $at_stderr || at_failed=:
   4984 echo stdout:; tee stdout <$at_stdout
   4985 case $at_status in
   4986    77) echo 77 > $at_status_file
   4987             exit 77;;
   4988    0) ;;
   4989    *) echo "synclines.at:95: exit code was $at_status, expected 0"
   4990       at_failed=:;;
   4991 esac
   4992 if $at_failed; then
   4993 
   4994   echo 1 > $at_status_file
   4995   exit 1
   4996 fi
   4997 
   4998 $at_traceon
   4999 
   5000 
   5001 $at_traceoff
   5002 echo "synclines.at:95: cat stdout"
   5003 echo synclines.at:95 >$at_check_line_file
   5004 ( $at_traceon; cat stdout ) >$at_stdout 2>$at_stder1
   5005 at_status=$?
   5006 grep '^ *+' $at_stder1 >&2
   5007 grep -v '^ *+' $at_stder1 >$at_stderr
   5008 at_failed=false
   5009 $at_diff $at_devnull $at_stderr || at_failed=:
   5010 echo >>$at_stdout; echo "input.y:2: #error \"2\"
   5011 " | $at_diff - $at_stdout || at_failed=:
   5012 case $at_status in
   5013    77) echo 77 > $at_status_file
   5014             exit 77;;
   5015    0) ;;
   5016    *) echo "synclines.at:95: exit code was $at_status, expected 0"
   5017       at_failed=:;;
   5018 esac
   5019 if $at_failed; then
   5020 
   5021   echo 1 > $at_status_file
   5022   exit 1
   5023 fi
   5024 
   5025 $at_traceon
   5026 
   5027       $at_traceoff
   5028       $at_times_p && times >$at_times_file
   5029     ) 5>&1 2>&1 | eval $at_tee_pipe
   5030     at_status=`cat $at_status_file`
   5031     ;;
   5032 
   5033   42 ) # 42. synclines.at:115: %union synch line
   5034     at_setup_line='synclines.at:115'
   5035     at_desc='%union synch line'
   5036     $at_quiet $ECHO_N " 42: %union synch line                            $ECHO_C"
   5037     at_xfail=no
   5038     (
   5039       echo "42. synclines.at:115: testing ..."
   5040       $at_traceon
   5041 
   5042 
   5043 # It seems impossible to find a generic scheme to check the location
   5044 # of an error.  Even requiring GCC is not sufficient, since for instance
   5045 # the version modified by Apple:
   5046 #
   5047 # | Reading specs from /usr/libexec/gcc/darwin/ppc/2.95.2/specs
   5048 # | Apple Computer, Inc. version gcc-934.3, based on gcc version 2.95.2
   5049 # | 19991024 (release) configure:2124: $? = 0
   5050 #
   5051 # instead of:
   5052 #
   5053 # | input.y:2: #error "2"
   5054 #
   5055 # it reports:
   5056 #
   5057 # | input.y:2: "2"
   5058 # | cpp-precomp: warning: errors during smart preprocessing, retrying in basic mode
   5059 
   5060 cat >syncline.c <<'_ATEOF'
   5061 #error "1"
   5062 _ATEOF
   5063 
   5064 
   5065 $at_traceoff
   5066 echo "synclines.at:115: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c"
   5067 echo synclines.at:115 >$at_check_line_file
   5068 ( $at_traceon; $CC $CFLAGS $CPPFLAGS -c syncline.c ) >$at_stdout 2>$at_stder1
   5069 at_status=$?
   5070 grep '^ *+' $at_stder1 >&2
   5071 grep -v '^ *+' $at_stder1 >$at_stderr
   5072 at_failed=false
   5073 echo stderr:; tee stderr <$at_stderr
   5074 $at_diff $at_devnull $at_stdout || at_failed=:
   5075 case $at_status in
   5076    77) echo 77 > $at_status_file
   5077             exit 77;;
   5078    *);;
   5079 esac
   5080 if $at_failed; then
   5081 
   5082   echo 1 > $at_status_file
   5083   exit 1
   5084 fi
   5085 
   5086 $at_traceon
   5087 
   5088 # In case GCC displays column information, strip it down.
   5089 #
   5090 #   input.y:4:2: #error "4"    or
   5091 #   input.y:4.2: #error "4"    or
   5092 #   input.y:4:2: error: #error "4"
   5093 # =>
   5094 #   input.y:4: #error "4"
   5095 #
   5096 $at_traceoff
   5097 echo "synclines.at:115: sed -e 's/^\\([^:]*:[^:.]*\\)[.:][^:]*:\\(.*\\)\$/\\1:\\2/' -e 's/^\\([^:]*:[^:]*:\\)[^#]*\\( #error\\)/\\1\\2/' stderr"
   5098 echo synclines.at:115 >$at_check_line_file
   5099 ( $at_traceon; sed -e 's/^\([^:]*:[^:.]*\)[.:][^:]*:\(.*\)$/\1:\2/' -e 's/^\([^:]*:[^:]*:\)[^#]*\( #error\)/\1\2/' stderr ) >$at_stdout 2>$at_stder1
   5100 at_status=$?
   5101 grep '^ *+' $at_stder1 >&2
   5102 grep -v '^ *+' $at_stder1 >$at_stderr
   5103 at_failed=false
   5104 $at_diff $at_devnull $at_stderr || at_failed=:
   5105 echo stdout:; tee stdout <$at_stdout
   5106 case $at_status in
   5107    77) echo 77 > $at_status_file
   5108             exit 77;;
   5109    0) ;;
   5110    *) echo "synclines.at:115: exit code was $at_status, expected 0"
   5111       at_failed=:;;
   5112 esac
   5113 if $at_failed; then
   5114 
   5115   echo 1 > $at_status_file
   5116   exit 1
   5117 fi
   5118 
   5119 $at_traceon
   5120 
   5121 
   5122 $at_traceoff
   5123 echo "synclines.at:115: test \"\`cat stdout\`\" = 'syncline.c:1: #error \"1\"' || exit 77"
   5124 echo synclines.at:115 >$at_check_line_file
   5125 ( $at_traceon; test "`cat stdout`" = 'syncline.c:1: #error "1"' || exit 77 ) >$at_stdout 2>$at_stder1
   5126 at_status=$?
   5127 grep '^ *+' $at_stder1 >&2
   5128 grep -v '^ *+' $at_stder1 >$at_stderr
   5129 at_failed=false
   5130 $at_diff $at_devnull $at_stderr || at_failed=:
   5131 $at_diff $at_devnull $at_stdout || at_failed=:
   5132 case $at_status in
   5133    77) echo 77 > $at_status_file
   5134             exit 77;;
   5135    0) ;;
   5136    *) echo "synclines.at:115: exit code was $at_status, expected 0"
   5137       at_failed=:;;
   5138 esac
   5139 if $at_failed; then
   5140 
   5141   echo 1 > $at_status_file
   5142   exit 1
   5143 fi
   5144 
   5145 $at_traceon
   5146 
   5147 
   5148 cat >input.y <<'_ATEOF'
   5149 %union {
   5150 #error "2"
   5151   char dummy;
   5152 }
   5153 %{
   5154 void yyerror (const char *s);
   5155 int yylex (void);
   5156 %}
   5157 %%
   5158 exp: '0';
   5159 _ATEOF
   5160 
   5161 $at_traceoff
   5162 echo "synclines.at:115: bison -o input.c input.y"
   5163 echo synclines.at:115 >$at_check_line_file
   5164 ( $at_traceon; bison -o input.c input.y ) >$at_stdout 2>$at_stder1
   5165 at_status=$?
   5166 grep '^ *+' $at_stder1 >&2
   5167 grep -v '^ *+' $at_stder1 >$at_stderr
   5168 at_failed=false
   5169 $at_diff $at_devnull $at_stderr || at_failed=:
   5170 $at_diff $at_devnull $at_stdout || at_failed=:
   5171 case $at_status in
   5172    77) echo 77 > $at_status_file
   5173             exit 77;;
   5174    0) ;;
   5175    *) echo "synclines.at:115: exit code was $at_status, expected 0"
   5176       at_failed=:;;
   5177 esac
   5178 if $at_failed; then
   5179 
   5180   echo 1 > $at_status_file
   5181   exit 1
   5182 fi
   5183 
   5184 $at_traceon
   5185 
   5186 $at_traceoff
   5187 echo "synclines.at:115: \$CC \$CFLAGS \$CPPFLAGS -c input.c"
   5188 echo synclines.at:115 >$at_check_line_file
   5189 ( $at_traceon; $CC $CFLAGS $CPPFLAGS -c input.c ) >$at_stdout 2>$at_stder1
   5190 at_status=$?
   5191 grep '^ *+' $at_stder1 >&2
   5192 grep -v '^ *+' $at_stder1 >$at_stderr
   5193 at_failed=false
   5194 echo stderr:; tee stderr <$at_stderr
   5195 $at_diff $at_devnull $at_stdout || at_failed=:
   5196 case $at_status in
   5197    77) echo 77 > $at_status_file
   5198             exit 77;;
   5199    *);;
   5200 esac
   5201 if $at_failed; then
   5202 
   5203   echo 1 > $at_status_file
   5204   exit 1
   5205 fi
   5206 
   5207 $at_traceon
   5208 
   5209 # In case GCC displays column information, strip it down.
   5210 #
   5211 #   input.y:4:2: #error "4"    or
   5212 #   input.y:4.2: #error "4"    or
   5213 #   input.y:4:2: error: #error "4"
   5214 # =>
   5215 #   input.y:4: #error "4"
   5216 #
   5217 $at_traceoff
   5218 echo "synclines.at:115: sed -e 's/^\\([^:]*:[^:.]*\\)[.:][^:]*:\\(.*\\)\$/\\1:\\2/' -e 's/^\\([^:]*:[^:]*:\\)[^#]*\\( #error\\)/\\1\\2/' stderr"
   5219 echo synclines.at:115 >$at_check_line_file
   5220 ( $at_traceon; sed -e 's/^\([^:]*:[^:.]*\)[.:][^:]*:\(.*\)$/\1:\2/' -e 's/^\([^:]*:[^:]*:\)[^#]*\( #error\)/\1\2/' stderr ) >$at_stdout 2>$at_stder1
   5221 at_status=$?
   5222 grep '^ *+' $at_stder1 >&2
   5223 grep -v '^ *+' $at_stder1 >$at_stderr
   5224 at_failed=false
   5225 $at_diff $at_devnull $at_stderr || at_failed=:
   5226 echo stdout:; tee stdout <$at_stdout
   5227 case $at_status in
   5228    77) echo 77 > $at_status_file
   5229             exit 77;;
   5230    0) ;;
   5231    *) echo "synclines.at:115: exit code was $at_status, expected 0"
   5232       at_failed=:;;
   5233 esac
   5234 if $at_failed; then
   5235 
   5236   echo 1 > $at_status_file
   5237   exit 1
   5238 fi
   5239 
   5240 $at_traceon
   5241 
   5242 
   5243 $at_traceoff
   5244 echo "synclines.at:115: cat stdout"
   5245 echo synclines.at:115 >$at_check_line_file
   5246 ( $at_traceon; cat stdout ) >$at_stdout 2>$at_stder1
   5247 at_status=$?
   5248 grep '^ *+' $at_stder1 >&2
   5249 grep -v '^ *+' $at_stder1 >$at_stderr
   5250 at_failed=false
   5251 $at_diff $at_devnull $at_stderr || at_failed=:
   5252 echo >>$at_stdout; echo "input.y:2: #error \"2\"
   5253 " | $at_diff - $at_stdout || at_failed=:
   5254 case $at_status in
   5255    77) echo 77 > $at_status_file
   5256             exit 77;;
   5257    0) ;;
   5258    *) echo "synclines.at:115: exit code was $at_status, expected 0"
   5259       at_failed=:;;
   5260 esac
   5261 if $at_failed; then
   5262 
   5263   echo 1 > $at_status_file
   5264   exit 1
   5265 fi
   5266 
   5267 $at_traceon
   5268 
   5269       $at_traceoff
   5270       $at_times_p && times >$at_times_file
   5271     ) 5>&1 2>&1 | eval $at_tee_pipe
   5272     at_status=`cat $at_status_file`
   5273     ;;
   5274 
   5275   43 ) # 43. synclines.at:138: Postprologue synch line
   5276     at_setup_line='synclines.at:138'
   5277     at_desc='Postprologue synch line'
   5278     $at_quiet $ECHO_N " 43: Postprologue synch line                      $ECHO_C"
   5279     at_xfail=no
   5280     (
   5281       echo "43. synclines.at:138: testing ..."
   5282       $at_traceon
   5283 
   5284 
   5285 # It seems impossible to find a generic scheme to check the location
   5286 # of an error.  Even requiring GCC is not sufficient, since for instance
   5287 # the version modified by Apple:
   5288 #
   5289 # | Reading specs from /usr/libexec/gcc/darwin/ppc/2.95.2/specs
   5290 # | Apple Computer, Inc. version gcc-934.3, based on gcc version 2.95.2
   5291 # | 19991024 (release) configure:2124: $? = 0
   5292 #
   5293 # instead of:
   5294 #
   5295 # | input.y:2: #error "2"
   5296 #
   5297 # it reports:
   5298 #
   5299 # | input.y:2: "2"
   5300 # | cpp-precomp: warning: errors during smart preprocessing, retrying in basic mode
   5301 
   5302 cat >syncline.c <<'_ATEOF'
   5303 #error "1"
   5304 _ATEOF
   5305 
   5306 
   5307 $at_traceoff
   5308 echo "synclines.at:138: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c"
   5309 echo synclines.at:138 >$at_check_line_file
   5310 ( $at_traceon; $CC $CFLAGS $CPPFLAGS -c syncline.c ) >$at_stdout 2>$at_stder1
   5311 at_status=$?
   5312 grep '^ *+' $at_stder1 >&2
   5313 grep -v '^ *+' $at_stder1 >$at_stderr
   5314 at_failed=false
   5315 echo stderr:; tee stderr <$at_stderr
   5316 $at_diff $at_devnull $at_stdout || at_failed=:
   5317 case $at_status in
   5318    77) echo 77 > $at_status_file
   5319             exit 77;;
   5320    *);;
   5321 esac
   5322 if $at_failed; then
   5323 
   5324   echo 1 > $at_status_file
   5325   exit 1
   5326 fi
   5327 
   5328 $at_traceon
   5329 
   5330 # In case GCC displays column information, strip it down.
   5331 #
   5332 #   input.y:4:2: #error "4"    or
   5333 #   input.y:4.2: #error "4"    or
   5334 #   input.y:4:2: error: #error "4"
   5335 # =>
   5336 #   input.y:4: #error "4"
   5337 #
   5338 $at_traceoff
   5339 echo "synclines.at:138: sed -e 's/^\\([^:]*:[^:.]*\\)[.:][^:]*:\\(.*\\)\$/\\1:\\2/' -e 's/^\\([^:]*:[^:]*:\\)[^#]*\\( #error\\)/\\1\\2/' stderr"
   5340 echo synclines.at:138 >$at_check_line_file
   5341 ( $at_traceon; sed -e 's/^\([^:]*:[^:.]*\)[.:][^:]*:\(.*\)$/\1:\2/' -e 's/^\([^:]*:[^:]*:\)[^#]*\( #error\)/\1\2/' stderr ) >$at_stdout 2>$at_stder1
   5342 at_status=$?
   5343 grep '^ *+' $at_stder1 >&2
   5344 grep -v '^ *+' $at_stder1 >$at_stderr
   5345 at_failed=false
   5346 $at_diff $at_devnull $at_stderr || at_failed=:
   5347 echo stdout:; tee stdout <$at_stdout
   5348 case $at_status in
   5349    77) echo 77 > $at_status_file
   5350             exit 77;;
   5351    0) ;;
   5352    *) echo "synclines.at:138: exit code was $at_status, expected 0"
   5353       at_failed=:;;
   5354 esac
   5355 if $at_failed; then
   5356 
   5357   echo 1 > $at_status_file
   5358   exit 1
   5359 fi
   5360 
   5361 $at_traceon
   5362 
   5363 
   5364 $at_traceoff
   5365 echo "synclines.at:138: test \"\`cat stdout\`\" = 'syncline.c:1: #error \"1\"' || exit 77"
   5366 echo synclines.at:138 >$at_check_line_file
   5367 ( $at_traceon; test "`cat stdout`" = 'syncline.c:1: #error "1"' || exit 77 ) >$at_stdout 2>$at_stder1
   5368 at_status=$?
   5369 grep '^ *+' $at_stder1 >&2
   5370 grep -v '^ *+' $at_stder1 >$at_stderr
   5371 at_failed=false
   5372 $at_diff $at_devnull $at_stderr || at_failed=:
   5373 $at_diff $at_devnull $at_stdout || at_failed=:
   5374 case $at_status in
   5375    77) echo 77 > $at_status_file
   5376             exit 77;;
   5377    0) ;;
   5378    *) echo "synclines.at:138: exit code was $at_status, expected 0"
   5379       at_failed=:;;
   5380 esac
   5381 if $at_failed; then
   5382 
   5383   echo 1 > $at_status_file
   5384   exit 1
   5385 fi
   5386 
   5387 $at_traceon
   5388 
   5389 
   5390 cat >input.y <<'_ATEOF'
   5391 %{
   5392 void yyerror (const char *s);
   5393 int yylex (void);
   5394 %}
   5395 %union
   5396 {
   5397   int ival;
   5398 }
   5399 %{
   5400 #error "10"
   5401 %}
   5402 %%
   5403 exp: '0';
   5404 _ATEOF
   5405 
   5406 $at_traceoff
   5407 echo "synclines.at:138: bison -o input.c input.y"
   5408 echo synclines.at:138 >$at_check_line_file
   5409 ( $at_traceon; bison -o input.c input.y ) >$at_stdout 2>$at_stder1
   5410 at_status=$?
   5411 grep '^ *+' $at_stder1 >&2
   5412 grep -v '^ *+' $at_stder1 >$at_stderr
   5413 at_failed=false
   5414 $at_diff $at_devnull $at_stderr || at_failed=:
   5415 $at_diff $at_devnull $at_stdout || at_failed=:
   5416 case $at_status in
   5417    77) echo 77 > $at_status_file
   5418             exit 77;;
   5419    0) ;;
   5420    *) echo "synclines.at:138: exit code was $at_status, expected 0"
   5421       at_failed=:;;
   5422 esac
   5423 if $at_failed; then
   5424 
   5425   echo 1 > $at_status_file
   5426   exit 1
   5427 fi
   5428 
   5429 $at_traceon
   5430 
   5431 $at_traceoff
   5432 echo "synclines.at:138: \$CC \$CFLAGS \$CPPFLAGS -c input.c"
   5433 echo synclines.at:138 >$at_check_line_file
   5434 ( $at_traceon; $CC $CFLAGS $CPPFLAGS -c input.c ) >$at_stdout 2>$at_stder1
   5435 at_status=$?
   5436 grep '^ *+' $at_stder1 >&2
   5437 grep -v '^ *+' $at_stder1 >$at_stderr
   5438 at_failed=false
   5439 echo stderr:; tee stderr <$at_stderr
   5440 $at_diff $at_devnull $at_stdout || at_failed=:
   5441 case $at_status in
   5442    77) echo 77 > $at_status_file
   5443             exit 77;;
   5444    *);;
   5445 esac
   5446 if $at_failed; then
   5447 
   5448   echo 1 > $at_status_file
   5449   exit 1
   5450 fi
   5451 
   5452 $at_traceon
   5453 
   5454 # In case GCC displays column information, strip it down.
   5455 #
   5456 #   input.y:4:2: #error "4"    or
   5457 #   input.y:4.2: #error "4"    or
   5458 #   input.y:4:2: error: #error "4"
   5459 # =>
   5460 #   input.y:4: #error "4"
   5461 #
   5462 $at_traceoff
   5463 echo "synclines.at:138: sed -e 's/^\\([^:]*:[^:.]*\\)[.:][^:]*:\\(.*\\)\$/\\1:\\2/' -e 's/^\\([^:]*:[^:]*:\\)[^#]*\\( #error\\)/\\1\\2/' stderr"
   5464 echo synclines.at:138 >$at_check_line_file
   5465 ( $at_traceon; sed -e 's/^\([^:]*:[^:.]*\)[.:][^:]*:\(.*\)$/\1:\2/' -e 's/^\([^:]*:[^:]*:\)[^#]*\( #error\)/\1\2/' stderr ) >$at_stdout 2>$at_stder1
   5466 at_status=$?
   5467 grep '^ *+' $at_stder1 >&2
   5468 grep -v '^ *+' $at_stder1 >$at_stderr
   5469 at_failed=false
   5470 $at_diff $at_devnull $at_stderr || at_failed=:
   5471 echo stdout:; tee stdout <$at_stdout
   5472 case $at_status in
   5473    77) echo 77 > $at_status_file
   5474             exit 77;;
   5475    0) ;;
   5476    *) echo "synclines.at:138: exit code was $at_status, expected 0"
   5477       at_failed=:;;
   5478 esac
   5479 if $at_failed; then
   5480 
   5481   echo 1 > $at_status_file
   5482   exit 1
   5483 fi
   5484 
   5485 $at_traceon
   5486 
   5487 
   5488 $at_traceoff
   5489 echo "synclines.at:138: cat stdout"
   5490 echo synclines.at:138 >$at_check_line_file
   5491 ( $at_traceon; cat stdout ) >$at_stdout 2>$at_stder1
   5492 at_status=$?
   5493 grep '^ *+' $at_stder1 >&2
   5494 grep -v '^ *+' $at_stder1 >$at_stderr
   5495 at_failed=false
   5496 $at_diff $at_devnull $at_stderr || at_failed=:
   5497 echo >>$at_stdout; echo "input.y:10: #error \"10\"
   5498 " | $at_diff - $at_stdout || at_failed=:
   5499 case $at_status in
   5500    77) echo 77 > $at_status_file
   5501             exit 77;;
   5502    0) ;;
   5503    *) echo "synclines.at:138: exit code was $at_status, expected 0"
   5504       at_failed=:;;
   5505 esac
   5506 if $at_failed; then
   5507 
   5508   echo 1 > $at_status_file
   5509   exit 1
   5510 fi
   5511 
   5512 $at_traceon
   5513 
   5514       $at_traceoff
   5515       $at_times_p && times >$at_times_file
   5516     ) 5>&1 2>&1 | eval $at_tee_pipe
   5517     at_status=`cat $at_status_file`
   5518     ;;
   5519 
   5520   44 ) # 44. synclines.at:157: Action synch line
   5521     at_setup_line='synclines.at:157'
   5522     at_desc='Action synch line'
   5523     $at_quiet $ECHO_N " 44: Action synch line                            $ECHO_C"
   5524     at_xfail=no
   5525     (
   5526       echo "44. synclines.at:157: testing ..."
   5527       $at_traceon
   5528 
   5529 
   5530 # It seems impossible to find a generic scheme to check the location
   5531 # of an error.  Even requiring GCC is not sufficient, since for instance
   5532 # the version modified by Apple:
   5533 #
   5534 # | Reading specs from /usr/libexec/gcc/darwin/ppc/2.95.2/specs
   5535 # | Apple Computer, Inc. version gcc-934.3, based on gcc version 2.95.2
   5536 # | 19991024 (release) configure:2124: $? = 0
   5537 #
   5538 # instead of:
   5539 #
   5540 # | input.y:2: #error "2"
   5541 #
   5542 # it reports:
   5543 #
   5544 # | input.y:2: "2"
   5545 # | cpp-precomp: warning: errors during smart preprocessing, retrying in basic mode
   5546 
   5547 cat >syncline.c <<'_ATEOF'
   5548 #error "1"
   5549 _ATEOF
   5550 
   5551 
   5552 $at_traceoff
   5553 echo "synclines.at:157: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c"
   5554 echo synclines.at:157 >$at_check_line_file
   5555 ( $at_traceon; $CC $CFLAGS $CPPFLAGS -c syncline.c ) >$at_stdout 2>$at_stder1
   5556 at_status=$?
   5557 grep '^ *+' $at_stder1 >&2
   5558 grep -v '^ *+' $at_stder1 >$at_stderr
   5559 at_failed=false
   5560 echo stderr:; tee stderr <$at_stderr
   5561 $at_diff $at_devnull $at_stdout || at_failed=:
   5562 case $at_status in
   5563    77) echo 77 > $at_status_file
   5564             exit 77;;
   5565    *);;
   5566 esac
   5567 if $at_failed; then
   5568 
   5569   echo 1 > $at_status_file
   5570   exit 1
   5571 fi
   5572 
   5573 $at_traceon
   5574 
   5575 # In case GCC displays column information, strip it down.
   5576 #
   5577 #   input.y:4:2: #error "4"    or
   5578 #   input.y:4.2: #error "4"    or
   5579 #   input.y:4:2: error: #error "4"
   5580 # =>
   5581 #   input.y:4: #error "4"
   5582 #
   5583 $at_traceoff
   5584 echo "synclines.at:157: sed -e 's/^\\([^:]*:[^:.]*\\)[.:][^:]*:\\(.*\\)\$/\\1:\\2/' -e 's/^\\([^:]*:[^:]*:\\)[^#]*\\( #error\\)/\\1\\2/' stderr"
   5585 echo synclines.at:157 >$at_check_line_file
   5586 ( $at_traceon; sed -e 's/^\([^:]*:[^:.]*\)[.:][^:]*:\(.*\)$/\1:\2/' -e 's/^\([^:]*:[^:]*:\)[^#]*\( #error\)/\1\2/' stderr ) >$at_stdout 2>$at_stder1
   5587 at_status=$?
   5588 grep '^ *+' $at_stder1 >&2
   5589 grep -v '^ *+' $at_stder1 >$at_stderr
   5590 at_failed=false
   5591 $at_diff $at_devnull $at_stderr || at_failed=:
   5592 echo stdout:; tee stdout <$at_stdout
   5593 case $at_status in
   5594    77) echo 77 > $at_status_file
   5595             exit 77;;
   5596    0) ;;
   5597    *) echo "synclines.at:157: exit code was $at_status, expected 0"
   5598       at_failed=:;;
   5599 esac
   5600 if $at_failed; then
   5601 
   5602   echo 1 > $at_status_file
   5603   exit 1
   5604 fi
   5605 
   5606 $at_traceon
   5607 
   5608 
   5609 $at_traceoff
   5610 echo "synclines.at:157: test \"\`cat stdout\`\" = 'syncline.c:1: #error \"1\"' || exit 77"
   5611 echo synclines.at:157 >$at_check_line_file
   5612 ( $at_traceon; test "`cat stdout`" = 'syncline.c:1: #error "1"' || exit 77 ) >$at_stdout 2>$at_stder1
   5613 at_status=$?
   5614 grep '^ *+' $at_stder1 >&2
   5615 grep -v '^ *+' $at_stder1 >$at_stderr
   5616 at_failed=false
   5617 $at_diff $at_devnull $at_stderr || at_failed=:
   5618 $at_diff $at_devnull $at_stdout || at_failed=:
   5619 case $at_status in
   5620    77) echo 77 > $at_status_file
   5621             exit 77;;
   5622    0) ;;
   5623    *) echo "synclines.at:157: exit code was $at_status, expected 0"
   5624       at_failed=:;;
   5625 esac
   5626 if $at_failed; then
   5627 
   5628   echo 1 > $at_status_file
   5629   exit 1
   5630 fi
   5631 
   5632 $at_traceon
   5633 
   5634 
   5635 cat >input.y <<'_ATEOF'
   5636 %{
   5637 void yyerror (const char *s);
   5638 int yylex (void);
   5639 %}
   5640 %%
   5641 exp:
   5642 {
   5643 #error "8"
   5644 };
   5645 _ATEOF
   5646 
   5647 $at_traceoff
   5648 echo "synclines.at:157: bison -o input.c input.y"
   5649 echo synclines.at:157 >$at_check_line_file
   5650 ( $at_traceon; bison -o input.c input.y ) >$at_stdout 2>$at_stder1
   5651 at_status=$?
   5652 grep '^ *+' $at_stder1 >&2
   5653 grep -v '^ *+' $at_stder1 >$at_stderr
   5654 at_failed=false
   5655 $at_diff $at_devnull $at_stderr || at_failed=:
   5656 $at_diff $at_devnull $at_stdout || at_failed=:
   5657 case $at_status in
   5658    77) echo 77 > $at_status_file
   5659             exit 77;;
   5660    0) ;;
   5661    *) echo "synclines.at:157: exit code was $at_status, expected 0"
   5662       at_failed=:;;
   5663 esac
   5664 if $at_failed; then
   5665 
   5666   echo 1 > $at_status_file
   5667   exit 1
   5668 fi
   5669 
   5670 $at_traceon
   5671 
   5672 $at_traceoff
   5673 echo "synclines.at:157: \$CC \$CFLAGS \$CPPFLAGS -c input.c"
   5674 echo synclines.at:157 >$at_check_line_file
   5675 ( $at_traceon; $CC $CFLAGS $CPPFLAGS -c input.c ) >$at_stdout 2>$at_stder1
   5676 at_status=$?
   5677 grep '^ *+' $at_stder1 >&2
   5678 grep -v '^ *+' $at_stder1 >$at_stderr
   5679 at_failed=false
   5680 echo stderr:; tee stderr <$at_stderr
   5681 $at_diff $at_devnull $at_stdout || at_failed=:
   5682 case $at_status in
   5683    77) echo 77 > $at_status_file
   5684             exit 77;;
   5685    *);;
   5686 esac
   5687 if $at_failed; then
   5688 
   5689   echo 1 > $at_status_file
   5690   exit 1
   5691 fi
   5692 
   5693 $at_traceon
   5694 
   5695 # In case GCC displays column information, strip it down.
   5696 #
   5697 #   input.y:4:2: #error "4"    or
   5698 #   input.y:4.2: #error "4"    or
   5699 #   input.y:4:2: error: #error "4"
   5700 # =>
   5701 #   input.y:4: #error "4"
   5702 #
   5703 $at_traceoff
   5704 echo "synclines.at:157: sed -e 's/^\\([^:]*:[^:.]*\\)[.:][^:]*:\\(.*\\)\$/\\1:\\2/' -e 's/^\\([^:]*:[^:]*:\\)[^#]*\\( #error\\)/\\1\\2/' stderr"
   5705 echo synclines.at:157 >$at_check_line_file
   5706 ( $at_traceon; sed -e 's/^\([^:]*:[^:.]*\)[.:][^:]*:\(.*\)$/\1:\2/' -e 's/^\([^:]*:[^:]*:\)[^#]*\( #error\)/\1\2/' stderr ) >$at_stdout 2>$at_stder1
   5707 at_status=$?
   5708 grep '^ *+' $at_stder1 >&2
   5709 grep -v '^ *+' $at_stder1 >$at_stderr
   5710 at_failed=false
   5711 $at_diff $at_devnull $at_stderr || at_failed=:
   5712 echo stdout:; tee stdout <$at_stdout
   5713 case $at_status in
   5714    77) echo 77 > $at_status_file
   5715             exit 77;;
   5716    0) ;;
   5717    *) echo "synclines.at:157: exit code was $at_status, expected 0"
   5718       at_failed=:;;
   5719 esac
   5720 if $at_failed; then
   5721 
   5722   echo 1 > $at_status_file
   5723   exit 1
   5724 fi
   5725 
   5726 $at_traceon
   5727 
   5728 
   5729 $at_traceoff
   5730 echo "synclines.at:157: cat stdout"
   5731 echo synclines.at:157 >$at_check_line_file
   5732 ( $at_traceon; cat stdout ) >$at_stdout 2>$at_stder1
   5733 at_status=$?
   5734 grep '^ *+' $at_stder1 >&2
   5735 grep -v '^ *+' $at_stder1 >$at_stderr
   5736 at_failed=false
   5737 $at_diff $at_devnull $at_stderr || at_failed=:
   5738 echo >>$at_stdout; echo "input.y:8: #error \"8\"
   5739 " | $at_diff - $at_stdout || at_failed=:
   5740 case $at_status in
   5741    77) echo 77 > $at_status_file
   5742             exit 77;;
   5743    0) ;;
   5744    *) echo "synclines.at:157: exit code was $at_status, expected 0"
   5745       at_failed=:;;
   5746 esac
   5747 if $at_failed; then
   5748 
   5749   echo 1 > $at_status_file
   5750   exit 1
   5751 fi
   5752 
   5753 $at_traceon
   5754 
   5755       $at_traceoff
   5756       $at_times_p && times >$at_times_file
   5757     ) 5>&1 2>&1 | eval $at_tee_pipe
   5758     at_status=`cat $at_status_file`
   5759     ;;
   5760 
   5761   45 ) # 45. synclines.at:175: Epilogue synch line
   5762     at_setup_line='synclines.at:175'
   5763     at_desc='Epilogue synch line'
   5764     $at_quiet $ECHO_N " 45: Epilogue synch line                          $ECHO_C"
   5765     at_xfail=no
   5766     (
   5767       echo "45. synclines.at:175: testing ..."
   5768       $at_traceon
   5769 
   5770 
   5771 # It seems impossible to find a generic scheme to check the location
   5772 # of an error.  Even requiring GCC is not sufficient, since for instance
   5773 # the version modified by Apple:
   5774 #
   5775 # | Reading specs from /usr/libexec/gcc/darwin/ppc/2.95.2/specs
   5776 # | Apple Computer, Inc. version gcc-934.3, based on gcc version 2.95.2
   5777 # | 19991024 (release) configure:2124: $? = 0
   5778 #
   5779 # instead of:
   5780 #
   5781 # | input.y:2: #error "2"
   5782 #
   5783 # it reports:
   5784 #
   5785 # | input.y:2: "2"
   5786 # | cpp-precomp: warning: errors during smart preprocessing, retrying in basic mode
   5787 
   5788 cat >syncline.c <<'_ATEOF'
   5789 #error "1"
   5790 _ATEOF
   5791 
   5792 
   5793 $at_traceoff
   5794 echo "synclines.at:175: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c"
   5795 echo synclines.at:175 >$at_check_line_file
   5796 ( $at_traceon; $CC $CFLAGS $CPPFLAGS -c syncline.c ) >$at_stdout 2>$at_stder1
   5797 at_status=$?
   5798 grep '^ *+' $at_stder1 >&2
   5799 grep -v '^ *+' $at_stder1 >$at_stderr
   5800 at_failed=false
   5801 echo stderr:; tee stderr <$at_stderr
   5802 $at_diff $at_devnull $at_stdout || at_failed=:
   5803 case $at_status in
   5804    77) echo 77 > $at_status_file
   5805             exit 77;;
   5806    *);;
   5807 esac
   5808 if $at_failed; then
   5809 
   5810   echo 1 > $at_status_file
   5811   exit 1
   5812 fi
   5813 
   5814 $at_traceon
   5815 
   5816 # In case GCC displays column information, strip it down.
   5817 #
   5818 #   input.y:4:2: #error "4"    or
   5819 #   input.y:4.2: #error "4"    or
   5820 #   input.y:4:2: error: #error "4"
   5821 # =>
   5822 #   input.y:4: #error "4"
   5823 #
   5824 $at_traceoff
   5825 echo "synclines.at:175: sed -e 's/^\\([^:]*:[^:.]*\\)[.:][^:]*:\\(.*\\)\$/\\1:\\2/' -e 's/^\\([^:]*:[^:]*:\\)[^#]*\\( #error\\)/\\1\\2/' stderr"
   5826 echo synclines.at:175 >$at_check_line_file
   5827 ( $at_traceon; sed -e 's/^\([^:]*:[^:.]*\)[.:][^:]*:\(.*\)$/\1:\2/' -e 's/^\([^:]*:[^:]*:\)[^#]*\( #error\)/\1\2/' stderr ) >$at_stdout 2>$at_stder1
   5828 at_status=$?
   5829 grep '^ *+' $at_stder1 >&2
   5830 grep -v '^ *+' $at_stder1 >$at_stderr
   5831 at_failed=false
   5832 $at_diff $at_devnull $at_stderr || at_failed=:
   5833 echo stdout:; tee stdout <$at_stdout
   5834 case $at_status in
   5835    77) echo 77 > $at_status_file
   5836             exit 77;;
   5837    0) ;;
   5838    *) echo "synclines.at:175: exit code was $at_status, expected 0"
   5839       at_failed=:;;
   5840 esac
   5841 if $at_failed; then
   5842 
   5843   echo 1 > $at_status_file
   5844   exit 1
   5845 fi
   5846 
   5847 $at_traceon
   5848 
   5849 
   5850 $at_traceoff
   5851 echo "synclines.at:175: test \"\`cat stdout\`\" = 'syncline.c:1: #error \"1\"' || exit 77"
   5852 echo synclines.at:175 >$at_check_line_file
   5853 ( $at_traceon; test "`cat stdout`" = 'syncline.c:1: #error "1"' || exit 77 ) >$at_stdout 2>$at_stder1
   5854 at_status=$?
   5855 grep '^ *+' $at_stder1 >&2
   5856 grep -v '^ *+' $at_stder1 >$at_stderr
   5857 at_failed=false
   5858 $at_diff $at_devnull $at_stderr || at_failed=:
   5859 $at_diff $at_devnull $at_stdout || at_failed=:
   5860 case $at_status in
   5861    77) echo 77 > $at_status_file
   5862             exit 77;;
   5863    0) ;;
   5864    *) echo "synclines.at:175: exit code was $at_status, expected 0"
   5865       at_failed=:;;
   5866 esac
   5867 if $at_failed; then
   5868 
   5869   echo 1 > $at_status_file
   5870   exit 1
   5871 fi
   5872 
   5873 $at_traceon
   5874 
   5875 
   5876 cat >input.y <<'_ATEOF'
   5877 %{
   5878 void yyerror (const char *s);
   5879 int yylex (void);
   5880 %}
   5881 %%
   5882 exp: '0';
   5883 %%
   5884 #error "8"
   5885 _ATEOF
   5886 
   5887 $at_traceoff
   5888 echo "synclines.at:175: bison -o input.c input.y"
   5889 echo synclines.at:175 >$at_check_line_file
   5890 ( $at_traceon; bison -o input.c input.y ) >$at_stdout 2>$at_stder1
   5891 at_status=$?
   5892 grep '^ *+' $at_stder1 >&2
   5893 grep -v '^ *+' $at_stder1 >$at_stderr
   5894 at_failed=false
   5895 $at_diff $at_devnull $at_stderr || at_failed=:
   5896 $at_diff $at_devnull $at_stdout || at_failed=:
   5897 case $at_status in
   5898    77) echo 77 > $at_status_file
   5899             exit 77;;
   5900    0) ;;
   5901    *) echo "synclines.at:175: exit code was $at_status, expected 0"
   5902       at_failed=:;;
   5903 esac
   5904 if $at_failed; then
   5905 
   5906   echo 1 > $at_status_file
   5907   exit 1
   5908 fi
   5909 
   5910 $at_traceon
   5911 
   5912 $at_traceoff
   5913 echo "synclines.at:175: \$CC \$CFLAGS \$CPPFLAGS -c input.c"
   5914 echo synclines.at:175 >$at_check_line_file
   5915 ( $at_traceon; $CC $CFLAGS $CPPFLAGS -c input.c ) >$at_stdout 2>$at_stder1
   5916 at_status=$?
   5917 grep '^ *+' $at_stder1 >&2
   5918 grep -v '^ *+' $at_stder1 >$at_stderr
   5919 at_failed=false
   5920 echo stderr:; tee stderr <$at_stderr
   5921 $at_diff $at_devnull $at_stdout || at_failed=:
   5922 case $at_status in
   5923    77) echo 77 > $at_status_file
   5924             exit 77;;
   5925    *);;
   5926 esac
   5927 if $at_failed; then
   5928 
   5929   echo 1 > $at_status_file
   5930   exit 1
   5931 fi
   5932 
   5933 $at_traceon
   5934 
   5935 # In case GCC displays column information, strip it down.
   5936 #
   5937 #   input.y:4:2: #error "4"    or
   5938 #   input.y:4.2: #error "4"    or
   5939 #   input.y:4:2: error: #error "4"
   5940 # =>
   5941 #   input.y:4: #error "4"
   5942 #
   5943 $at_traceoff
   5944 echo "synclines.at:175: sed -e 's/^\\([^:]*:[^:.]*\\)[.:][^:]*:\\(.*\\)\$/\\1:\\2/' -e 's/^\\([^:]*:[^:]*:\\)[^#]*\\( #error\\)/\\1\\2/' stderr"
   5945 echo synclines.at:175 >$at_check_line_file
   5946 ( $at_traceon; sed -e 's/^\([^:]*:[^:.]*\)[.:][^:]*:\(.*\)$/\1:\2/' -e 's/^\([^:]*:[^:]*:\)[^#]*\( #error\)/\1\2/' stderr ) >$at_stdout 2>$at_stder1
   5947 at_status=$?
   5948 grep '^ *+' $at_stder1 >&2
   5949 grep -v '^ *+' $at_stder1 >$at_stderr
   5950 at_failed=false
   5951 $at_diff $at_devnull $at_stderr || at_failed=:
   5952 echo stdout:; tee stdout <$at_stdout
   5953 case $at_status in
   5954    77) echo 77 > $at_status_file
   5955             exit 77;;
   5956    0) ;;
   5957    *) echo "synclines.at:175: exit code was $at_status, expected 0"
   5958       at_failed=:;;
   5959 esac
   5960 if $at_failed; then
   5961 
   5962   echo 1 > $at_status_file
   5963   exit 1
   5964 fi
   5965 
   5966 $at_traceon
   5967 
   5968 
   5969 $at_traceoff
   5970 echo "synclines.at:175: cat stdout"
   5971 echo synclines.at:175 >$at_check_line_file
   5972 ( $at_traceon; cat stdout ) >$at_stdout 2>$at_stder1
   5973 at_status=$?
   5974 grep '^ *+' $at_stder1 >&2
   5975 grep -v '^ *+' $at_stder1 >$at_stderr
   5976 at_failed=false
   5977 $at_diff $at_devnull $at_stderr || at_failed=:
   5978 echo >>$at_stdout; echo "input.y:8: #error \"8\"
   5979 " | $at_diff - $at_stdout || at_failed=:
   5980 case $at_status in
   5981    77) echo 77 > $at_status_file
   5982             exit 77;;
   5983    0) ;;
   5984    *) echo "synclines.at:175: exit code was $at_status, expected 0"
   5985       at_failed=:;;
   5986 esac
   5987 if $at_failed; then
   5988 
   5989   echo 1 > $at_status_file
   5990   exit 1
   5991 fi
   5992 
   5993 $at_traceon
   5994 
   5995       $at_traceoff
   5996       $at_times_p && times >$at_times_file
   5997     ) 5>&1 2>&1 | eval $at_tee_pipe
   5998     at_status=`cat $at_status_file`
   5999     ;;
   6000 
   6001 
   6002   banner-6 ) # Banner 6. headers.at:19
   6003     cat <<\_ATEOF
   6004 
   6005 Parser Headers.
   6006 
   6007 _ATEOF
   6008     ;;
   6009 
   6010   46 ) # 46. headers.at:27: %union and --defines
   6011     at_setup_line='headers.at:27'
   6012     at_desc='%union and --defines'
   6013     $at_quiet $ECHO_N " 46: %union and --defines                         $ECHO_C"
   6014     at_xfail=no
   6015     (
   6016       echo "46. headers.at:27: testing ..."
   6017       $at_traceon
   6018 
   6019 
   6020 cat >input.y <<'_ATEOF'
   6021 %union
   6022 {
   6023   int   integer;
   6024   char *string ;
   6025 }
   6026 %%
   6027 exp: {};
   6028 _ATEOF
   6029 
   6030 
   6031 $at_traceoff
   6032 echo "headers.at:39: bison --defines input.y"
   6033 echo headers.at:39 >$at_check_line_file
   6034 ( $at_traceon; bison --defines input.y ) >$at_stdout 2>$at_stder1
   6035 at_status=$?
   6036 grep '^ *+' $at_stder1 >&2
   6037 grep -v '^ *+' $at_stder1 >$at_stderr
   6038 at_failed=false
   6039 $at_diff $at_devnull $at_stderr || at_failed=:
   6040 $at_diff $at_devnull $at_stdout || at_failed=:
   6041 case $at_status in
   6042    77) echo 77 > $at_status_file
   6043             exit 77;;
   6044    0) ;;
   6045    *) echo "headers.at:39: exit code was $at_status, expected 0"
   6046       at_failed=:;;
   6047 esac
   6048 if $at_failed; then
   6049 
   6050   echo 1 > $at_status_file
   6051   exit 1
   6052 fi
   6053 
   6054 $at_traceon
   6055 
   6056 
   6057       $at_traceoff
   6058       $at_times_p && times >$at_times_file
   6059     ) 5>&1 2>&1 | eval $at_tee_pipe
   6060     at_status=`cat $at_status_file`
   6061     ;;
   6062 
   6063   47 ) # 47. headers.at:77: Invalid CPP guards: input/input
   6064     at_setup_line='headers.at:77'
   6065     at_desc='Invalid CPP guards: input/input'
   6066     $at_quiet $ECHO_N " 47: Invalid CPP guards: input/input              $ECHO_C"
   6067     at_xfail=no
   6068     (
   6069       echo "47. headers.at:77: testing ..."
   6070       $at_traceon
   6071 
   6072 
   6073 # Possibly create inner directories.
   6074 dirname=`(dirname input/input) 2>/dev/null ||
   6075 $as_expr Xinput/input : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
   6076 	 Xinput/input : 'X\(//\)[^/]' \| \
   6077 	 Xinput/input : 'X\(//\)$' \| \
   6078 	 Xinput/input : 'X\(/\)' \| \
   6079 	 .     : '\(.\)' 2>/dev/null ||
   6080 echo Xinput/input |
   6081     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
   6082   	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
   6083   	  /^X\(\/\/\)$/{ s//\1/; q; }
   6084   	  /^X\(\/\).*/{ s//\1/; q; }
   6085   	  s/.*/./; q'`
   6086 { if $as_mkdir_p; then
   6087     mkdir -p $dirname
   6088   else
   6089     as_dir=$dirname
   6090     as_dirs=
   6091     while test ! -d "$as_dir"; do
   6092       as_dirs="$as_dir $as_dirs"
   6093       as_dir=`(dirname "$as_dir") 2>/dev/null ||
   6094 $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
   6095 	 X"$as_dir" : 'X\(//\)[^/]' \| \
   6096 	 X"$as_dir" : 'X\(//\)$' \| \
   6097 	 X"$as_dir" : 'X\(/\)' \| \
   6098 	 .     : '\(.\)' 2>/dev/null ||
   6099 echo X"$as_dir" |
   6100     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
   6101   	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
   6102   	  /^X\(\/\/\)$/{ s//\1/; q; }
   6103   	  /^X\(\/\).*/{ s//\1/; q; }
   6104   	  s/.*/./; q'`
   6105     done
   6106     test ! -n "$as_dirs" || mkdir $as_dirs
   6107   fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirname" >&5
   6108 echo "$as_me: error: cannot create directory $dirname" >&2;}
   6109    { (exit 1); exit 1; }; }; }
   6110 
   6111 
   6112 cat >input/input.y <<'_ATEOF'
   6113 %{
   6114 #ifdef HAVE_CONFIG_H
   6115 # include <config.h>
   6116   /* We don't need perfect functions for these tests. */
   6117 # undef malloc
   6118 # undef memcmp
   6119 # undef realloc
   6120 #endif
   6121 %}
   6122 
   6123 %{
   6124 #include <input/input.h>
   6125 void yyerror (const char *);
   6126 int yylex (void);
   6127 %}
   6128 %%
   6129 dummy:;
   6130 %%
   6131 #include <input/input.h>
   6132 _ATEOF
   6133 
   6134 
   6135 
   6136 $at_traceoff
   6137 echo "headers.at:77: bison --defines=input/input.h --output=y.tab.c input/input.y"
   6138 echo headers.at:77 >$at_check_line_file
   6139 ( $at_traceon; bison --defines=input/input.h --output=y.tab.c input/input.y ) >$at_stdout 2>$at_stder1
   6140 at_status=$?
   6141 grep '^ *+' $at_stder1 >&2
   6142 grep -v '^ *+' $at_stder1 >$at_stderr
   6143 at_failed=false
   6144 $at_diff $at_devnull $at_stderr || at_failed=:
   6145 $at_diff $at_devnull $at_stdout || at_failed=:
   6146 case $at_status in
   6147    77) echo 77 > $at_status_file
   6148             exit 77;;
   6149    0) ;;
   6150    *) echo "headers.at:77: exit code was $at_status, expected 0"
   6151       at_failed=:;;
   6152 esac
   6153 if $at_failed; then
   6154 
   6155   echo 1 > $at_status_file
   6156   exit 1
   6157 fi
   6158 
   6159 $at_traceon
   6160 
   6161 
   6162 $at_traceoff
   6163 echo "headers.at:77: \$CC \$CFLAGS \$CPPFLAGS -o y.tab.o -I. -c y.tab.c"
   6164 echo headers.at:77 >$at_check_line_file
   6165 ( $at_traceon; $CC $CFLAGS $CPPFLAGS -o y.tab.o -I. -c y.tab.c ) >$at_stdout 2>$at_stder1
   6166 at_status=$?
   6167 grep '^ *+' $at_stder1 >&2
   6168 grep -v '^ *+' $at_stder1 >$at_stderr
   6169 at_failed=false
   6170 echo stderr:; cat $at_stderr
   6171 echo stdout:; cat $at_stdout
   6172 case $at_status in
   6173    77) echo 77 > $at_status_file
   6174             exit 77;;
   6175    0) ;;
   6176    *) echo "headers.at:77: exit code was $at_status, expected 0"
   6177       at_failed=:;;
   6178 esac
   6179 if $at_failed; then
   6180 
   6181   echo 1 > $at_status_file
   6182   exit 1
   6183 fi
   6184 
   6185 $at_traceon
   6186 
   6187 
   6188       $at_traceoff
   6189       $at_times_p && times >$at_times_file
   6190     ) 5>&1 2>&1 | eval $at_tee_pipe
   6191     at_status=`cat $at_status_file`
   6192     ;;
   6193 
   6194   48 ) # 48. headers.at:78: Invalid CPP guards: 9foo
   6195     at_setup_line='headers.at:78'
   6196     at_desc='Invalid CPP guards: 9foo'
   6197     $at_quiet $ECHO_N " 48: Invalid CPP guards: 9foo                     $ECHO_C"
   6198     at_xfail=no
   6199     (
   6200       echo "48. headers.at:78: testing ..."
   6201       $at_traceon
   6202 
   6203 
   6204 # Possibly create inner directories.
   6205 dirname=`(dirname 9foo) 2>/dev/null ||
   6206 $as_expr X9foo : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
   6207 	 X9foo : 'X\(//\)[^/]' \| \
   6208 	 X9foo : 'X\(//\)$' \| \
   6209 	 X9foo : 'X\(/\)' \| \
   6210 	 .     : '\(.\)' 2>/dev/null ||
   6211 echo X9foo |
   6212     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
   6213   	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
   6214   	  /^X\(\/\/\)$/{ s//\1/; q; }
   6215   	  /^X\(\/\).*/{ s//\1/; q; }
   6216   	  s/.*/./; q'`
   6217 { if $as_mkdir_p; then
   6218     mkdir -p $dirname
   6219   else
   6220     as_dir=$dirname
   6221     as_dirs=
   6222     while test ! -d "$as_dir"; do
   6223       as_dirs="$as_dir $as_dirs"
   6224       as_dir=`(dirname "$as_dir") 2>/dev/null ||
   6225 $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
   6226 	 X"$as_dir" : 'X\(//\)[^/]' \| \
   6227 	 X"$as_dir" : 'X\(//\)$' \| \
   6228 	 X"$as_dir" : 'X\(/\)' \| \
   6229 	 .     : '\(.\)' 2>/dev/null ||
   6230 echo X"$as_dir" |
   6231     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
   6232   	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
   6233   	  /^X\(\/\/\)$/{ s//\1/; q; }
   6234   	  /^X\(\/\).*/{ s//\1/; q; }
   6235   	  s/.*/./; q'`
   6236     done
   6237     test ! -n "$as_dirs" || mkdir $as_dirs
   6238   fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirname" >&5
   6239 echo "$as_me: error: cannot create directory $dirname" >&2;}
   6240    { (exit 1); exit 1; }; }; }
   6241 
   6242 
   6243 cat >9foo.y <<'_ATEOF'
   6244 %{
   6245 #ifdef HAVE_CONFIG_H
   6246 # include <config.h>
   6247   /* We don't need perfect functions for these tests. */
   6248 # undef malloc
   6249 # undef memcmp
   6250 # undef realloc
   6251 #endif
   6252 %}
   6253 
   6254 %{
   6255 #include <9foo.h>
   6256 void yyerror (const char *);
   6257 int yylex (void);
   6258 %}
   6259 %%
   6260 dummy:;
   6261 %%
   6262 #include <9foo.h>
   6263 _ATEOF
   6264 
   6265 
   6266 
   6267 $at_traceoff
   6268 echo "headers.at:78: bison --defines=9foo.h --output=y.tab.c 9foo.y"
   6269 echo headers.at:78 >$at_check_line_file
   6270 ( $at_traceon; bison --defines=9foo.h --output=y.tab.c 9foo.y ) >$at_stdout 2>$at_stder1
   6271 at_status=$?
   6272 grep '^ *+' $at_stder1 >&2
   6273 grep -v '^ *+' $at_stder1 >$at_stderr
   6274 at_failed=false
   6275 $at_diff $at_devnull $at_stderr || at_failed=:
   6276 $at_diff $at_devnull $at_stdout || at_failed=:
   6277 case $at_status in
   6278    77) echo 77 > $at_status_file
   6279             exit 77;;
   6280    0) ;;
   6281    *) echo "headers.at:78: exit code was $at_status, expected 0"
   6282       at_failed=:;;
   6283 esac
   6284 if $at_failed; then
   6285 
   6286   echo 1 > $at_status_file
   6287   exit 1
   6288 fi
   6289 
   6290 $at_traceon
   6291 
   6292 
   6293 $at_traceoff
   6294 echo "headers.at:78: \$CC \$CFLAGS \$CPPFLAGS -o y.tab.o -I. -c y.tab.c"
   6295 echo headers.at:78 >$at_check_line_file
   6296 ( $at_traceon; $CC $CFLAGS $CPPFLAGS -o y.tab.o -I. -c y.tab.c ) >$at_stdout 2>$at_stder1
   6297 at_status=$?
   6298 grep '^ *+' $at_stder1 >&2
   6299 grep -v '^ *+' $at_stder1 >$at_stderr
   6300 at_failed=false
   6301 echo stderr:; cat $at_stderr
   6302 echo stdout:; cat $at_stdout
   6303 case $at_status in
   6304    77) echo 77 > $at_status_file
   6305             exit 77;;
   6306    0) ;;
   6307    *) echo "headers.at:78: exit code was $at_status, expected 0"
   6308       at_failed=:;;
   6309 esac
   6310 if $at_failed; then
   6311 
   6312   echo 1 > $at_status_file
   6313   exit 1
   6314 fi
   6315 
   6316 $at_traceon
   6317 
   6318 
   6319       $at_traceoff
   6320       $at_times_p && times >$at_times_file
   6321     ) 5>&1 2>&1 | eval $at_tee_pipe
   6322     at_status=`cat $at_status_file`
   6323     ;;
   6324 
   6325   49 ) # 49. headers.at:87: export YYLTYPE
   6326     at_setup_line='headers.at:87'
   6327     at_desc='export YYLTYPE'
   6328     $at_quiet $ECHO_N " 49: export YYLTYPE                               $ECHO_C"
   6329     at_xfail=no
   6330     (
   6331       echo "49. headers.at:87: testing ..."
   6332       $at_traceon
   6333 
   6334 
   6335 cat >input.y <<'_ATEOF'
   6336 %{
   6337 #ifdef HAVE_CONFIG_H
   6338 # include <config.h>
   6339   /* We don't need perfect functions for these tests. */
   6340 # undef malloc
   6341 # undef memcmp
   6342 # undef realloc
   6343 #endif
   6344 %}
   6345 
   6346 %locations
   6347 
   6348 %name-prefix="my_"
   6349 %{
   6350 #include <stdio.h>
   6351 #include <stdlib.h>
   6352 
   6353 static int
   6354 my_lex (void)
   6355 {
   6356   return EOF;
   6357 }
   6358 
   6359 static void
   6360 my_error (const char *msg)
   6361 {
   6362   fprintf (stderr, "%s\n", msg);
   6363 }
   6364 
   6365 %}
   6366 %%
   6367 exp:;
   6368 _ATEOF
   6369 
   6370 
   6371 
   6372 $at_traceoff
   6373 echo "headers.at:114: bison --defines -o input.c input.y"
   6374 echo headers.at:114 >$at_check_line_file
   6375 ( $at_traceon; bison --defines -o input.c input.y ) >$at_stdout 2>$at_stder1
   6376 at_status=$?
   6377 grep '^ *+' $at_stder1 >&2
   6378 grep -v '^ *+' $at_stder1 >$at_stderr
   6379 at_failed=false
   6380 $at_diff $at_devnull $at_stderr || at_failed=:
   6381 $at_diff $at_devnull $at_stdout || at_failed=:
   6382 case $at_status in
   6383    77) echo 77 > $at_status_file
   6384             exit 77;;
   6385    0) ;;
   6386    *) echo "headers.at:114: exit code was $at_status, expected 0"
   6387       at_failed=:;;
   6388 esac
   6389 if $at_failed; then
   6390 
   6391   echo 1 > $at_status_file
   6392   exit 1
   6393 fi
   6394 
   6395 $at_traceon
   6396 
   6397 
   6398 # YYLTYPE should be defined, and MY_LLOC declared.
   6399 cat >caller.c <<'_ATEOF'
   6400 #include "input.h"
   6401 YYLTYPE *my_llocp = &my_lloc;
   6402 
   6403 int my_parse (void);
   6404 
   6405 int
   6406 main (void)
   6407 {
   6408   return my_parse ();
   6409 }
   6410 _ATEOF
   6411 
   6412 
   6413 # Link and execute, just to make sure everything is fine (and in
   6414 # particular, that MY_LLOC is indeed defined somewhere).
   6415 $at_traceoff
   6416 echo "headers.at:132: \$CC \$CFLAGS \$CPPFLAGS -o caller.o -c caller.c"
   6417 echo headers.at:132 >$at_check_line_file
   6418 ( $at_traceon; $CC $CFLAGS $CPPFLAGS -o caller.o -c caller.c ) >$at_stdout 2>$at_stder1
   6419 at_status=$?
   6420 grep '^ *+' $at_stder1 >&2
   6421 grep -v '^ *+' $at_stder1 >$at_stderr
   6422 at_failed=false
   6423 echo stderr:; cat $at_stderr
   6424 echo stdout:; cat $at_stdout
   6425 case $at_status in
   6426    77) echo 77 > $at_status_file
   6427             exit 77;;
   6428    0) ;;
   6429    *) echo "headers.at:132: exit code was $at_status, expected 0"
   6430       at_failed=:;;
   6431 esac
   6432 if $at_failed; then
   6433 
   6434   echo 1 > $at_status_file
   6435   exit 1
   6436 fi
   6437 
   6438 $at_traceon
   6439 
   6440 $at_traceoff
   6441 echo "headers.at:133: \$CC \$CFLAGS \$CPPFLAGS -o input.o -c input.c"
   6442 echo headers.at:133 >$at_check_line_file
   6443 ( $at_traceon; $CC $CFLAGS $CPPFLAGS -o input.o -c input.c ) >$at_stdout 2>$at_stder1
   6444 at_status=$?
   6445 grep '^ *+' $at_stder1 >&2
   6446 grep -v '^ *+' $at_stder1 >$at_stderr
   6447 at_failed=false
   6448 echo stderr:; cat $at_stderr
   6449 echo stdout:; cat $at_stdout
   6450 case $at_status in
   6451    77) echo 77 > $at_status_file
   6452             exit 77;;
   6453    0) ;;
   6454    *) echo "headers.at:133: exit code was $at_status, expected 0"
   6455       at_failed=:;;
   6456 esac
   6457 if $at_failed; then
   6458 
   6459   echo 1 > $at_status_file
   6460   exit 1
   6461 fi
   6462 
   6463 $at_traceon
   6464 
   6465 $at_traceoff
   6466 echo "headers.at:134: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o caller caller.o input.o \$LIBS"
   6467 echo headers.at:134 >$at_check_line_file
   6468 ( $at_traceon; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o caller caller.o input.o $LIBS ) >$at_stdout 2>$at_stder1
   6469 at_status=$?
   6470 grep '^ *+' $at_stder1 >&2
   6471 grep -v '^ *+' $at_stder1 >$at_stderr
   6472 at_failed=false
   6473 echo stderr:; cat $at_stderr
   6474 echo stdout:; cat $at_stdout
   6475 case $at_status in
   6476    77) echo 77 > $at_status_file
   6477             exit 77;;
   6478    0) ;;
   6479    *) echo "headers.at:134: exit code was $at_status, expected 0"
   6480       at_failed=:;;
   6481 esac
   6482 if $at_failed; then
   6483 
   6484   echo 1 > $at_status_file
   6485   exit 1
   6486 fi
   6487 
   6488 $at_traceon
   6489 
   6490 $at_traceoff
   6491 echo "headers.at:135: \$PREPARSER ./caller"
   6492 echo headers.at:135 >$at_check_line_file
   6493 ( $at_traceon; $PREPARSER ./caller ) >$at_stdout 2>$at_stder1
   6494 at_status=$?
   6495 grep '^ *+' $at_stder1 >&2
   6496 grep -v '^ *+' $at_stder1 >$at_stderr
   6497 at_failed=false
   6498 $at_diff $at_devnull $at_stderr || at_failed=:
   6499 $at_diff $at_devnull $at_stdout || at_failed=:
   6500 case $at_status in
   6501    77) echo 77 > $at_status_file
   6502             exit 77;;
   6503    0) ;;
   6504    *) echo "headers.at:135: exit code was $at_status, expected 0"
   6505       at_failed=:;;
   6506 esac
   6507 if $at_failed; then
   6508 
   6509   echo 1 > $at_status_file
   6510   exit 1
   6511 fi
   6512 
   6513 $at_traceon
   6514 
   6515 
   6516       $at_traceoff
   6517       $at_times_p && times >$at_times_file
   6518     ) 5>&1 2>&1 | eval $at_tee_pipe
   6519     at_status=`cat $at_status_file`
   6520     ;;
   6521 
   6522 
   6523   banner-7 ) # Banner 7. actions.at:19
   6524     cat <<\_ATEOF
   6525 
   6526 User Actions.
   6527 
   6528 _ATEOF
   6529     ;;
   6530 
   6531   50 ) # 50. actions.at:25: Mid-rule actions
   6532     at_setup_line='actions.at:25'
   6533     at_desc='Mid-rule actions'
   6534     $at_quiet $ECHO_N " 50: Mid-rule actions                             $ECHO_C"
   6535     at_xfail=no
   6536     (
   6537       echo "50. actions.at:25: testing ..."
   6538       $at_traceon
   6539 
   6540 
   6541 # Bison once forgot the mid-rule actions.  It was because the action
   6542 # was attached to the host rule (the one with the mid-rule action),
   6543 # instead of being attached to the empty rule dedicated to this
   6544 # action.
   6545 
   6546 cat >input.y <<'_ATEOF'
   6547 %{
   6548 #ifdef HAVE_CONFIG_H
   6549 # include <config.h>
   6550   /* We don't need perfect functions for these tests. */
   6551 # undef malloc
   6552 # undef memcmp
   6553 # undef realloc
   6554 #endif
   6555 %}
   6556 
   6557 %error-verbose
   6558 %debug
   6559 %{
   6560 # include <stdio.h>
   6561 # include <stdlib.h>
   6562   static void yyerror (const char *msg);
   6563   static int yylex (void);
   6564 %}
   6565 %%
   6566 exp:     { putchar ('0'); }
   6567      '1' { putchar ('1'); }
   6568      '2' { putchar ('2'); }
   6569      '3' { putchar ('3'); }
   6570      '4' { putchar ('4'); }
   6571      '5' { putchar ('5'); }
   6572      '6' { putchar ('6'); }
   6573      '7' { putchar ('7'); }
   6574      '8' { putchar ('8'); }
   6575      '9' { putchar ('9'); }
   6576          { putchar ('\n'); }
   6577    ;
   6578 %%
   6579 static int
   6580 yylex (void)
   6581 {
   6582   static const char *input = "123456789";
   6583   return *input++;
   6584 }
   6585 
   6586 static void
   6587 yyerror (const char *msg)
   6588 {
   6589   fprintf (stderr, "%s\n", msg);
   6590 }
   6591 
   6592 int
   6593 main (void)
   6594 {
   6595   return yyparse ();
   6596 }
   6597 _ATEOF
   6598 
   6599 
   6600 
   6601 $at_traceoff
   6602 echo "actions.at:75: bison -d -v -o input.c input.y"
   6603 echo actions.at:75 >$at_check_line_file
   6604 ( $at_traceon; bison -d -v -o input.c input.y ) >$at_stdout 2>$at_stder1
   6605 at_status=$?
   6606 grep '^ *+' $at_stder1 >&2
   6607 grep -v '^ *+' $at_stder1 >$at_stderr
   6608 at_failed=false
   6609 $at_diff $at_devnull $at_stderr || at_failed=:
   6610 $at_diff $at_devnull $at_stdout || at_failed=:
   6611 case $at_status in
   6612    77) echo 77 > $at_status_file
   6613             exit 77;;
   6614    0) ;;
   6615    *) echo "actions.at:75: exit code was $at_status, expected 0"
   6616       at_failed=:;;
   6617 esac
   6618 if $at_failed; then
   6619 
   6620   echo 1 > $at_status_file
   6621   exit 1
   6622 fi
   6623 
   6624 $at_traceon
   6625 
   6626 $at_traceoff
   6627 echo "actions.at:76: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   6628 echo actions.at:76 >$at_check_line_file
   6629 ( $at_traceon; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >$at_stdout 2>$at_stder1
   6630 at_status=$?
   6631 grep '^ *+' $at_stder1 >&2
   6632 grep -v '^ *+' $at_stder1 >$at_stderr
   6633 at_failed=false
   6634 echo stderr:; cat $at_stderr
   6635 echo stdout:; cat $at_stdout
   6636 case $at_status in
   6637    77) echo 77 > $at_status_file
   6638             exit 77;;
   6639    0) ;;
   6640    *) echo "actions.at:76: exit code was $at_status, expected 0"
   6641       at_failed=:;;
   6642 esac
   6643 if $at_failed; then
   6644 
   6645   echo 1 > $at_status_file
   6646   exit 1
   6647 fi
   6648 
   6649 $at_traceon
   6650 
   6651 $at_traceoff
   6652 echo "actions.at:79: \$PREPARSER ./input"
   6653 echo actions.at:79 >$at_check_line_file
   6654 ( $at_traceon; $PREPARSER ./input ) >$at_stdout 2>$at_stder1
   6655 at_status=$?
   6656 grep '^ *+' $at_stder1 >&2
   6657 grep -v '^ *+' $at_stder1 >$at_stderr
   6658 at_failed=false
   6659 $at_diff $at_devnull $at_stderr || at_failed=:
   6660 echo >>$at_stdout; echo "0123456789
   6661 " | $at_diff - $at_stdout || at_failed=:
   6662 case $at_status in
   6663    77) echo 77 > $at_status_file
   6664             exit 77;;
   6665    0) ;;
   6666    *) echo "actions.at:79: exit code was $at_status, expected 0"
   6667       at_failed=:;;
   6668 esac
   6669 if $at_failed; then
   6670 
   6671   echo 1 > $at_status_file
   6672   exit 1
   6673 fi
   6674 
   6675 $at_traceon
   6676 
   6677 
   6678       $at_traceoff
   6679       $at_times_p && times >$at_times_file
   6680     ) 5>&1 2>&1 | eval $at_tee_pipe
   6681     at_status=`cat $at_status_file`
   6682     ;;
   6683 
   6684   51 ) # 51. actions.at:91: Exotic Dollars
   6685     at_setup_line='actions.at:91'
   6686     at_desc='Exotic Dollars'
   6687     $at_quiet $ECHO_N " 51: Exotic Dollars                               $ECHO_C"
   6688     at_xfail=no
   6689     (
   6690       echo "51. actions.at:91: testing ..."
   6691       $at_traceon
   6692 
   6693 
   6694 cat >input.y <<'_ATEOF'
   6695 %{
   6696 #ifdef HAVE_CONFIG_H
   6697 # include <config.h>
   6698   /* We don't need perfect functions for these tests. */
   6699 # undef malloc
   6700 # undef memcmp
   6701 # undef realloc
   6702 #endif
   6703 %}
   6704 
   6705 %error-verbose
   6706 %debug
   6707 %{
   6708 # include <stdio.h>
   6709 # include <stdlib.h>
   6710   static void yyerror (const char *msg);
   6711   static int yylex (void);
   6712 # define USE(Var)
   6713 %}
   6714 
   6715 %union
   6716 {
   6717   int val;
   6718 };
   6719 
   6720 %type <val> a_1 a_2 a_5
   6721             sum_of_the_five_previous_values
   6722 
   6723 %%
   6724 exp: a_1 a_2 { $<val>$ = 3; } { $<val>$ = $<val>3 + 1; } a_5
   6725      sum_of_the_five_previous_values
   6726     {
   6727        USE (($1, $2, $<foo>3, $<foo>4, $5));
   6728        printf ("%d\n", $6);
   6729     }
   6730 ;
   6731 a_1: { $$ = 1; };
   6732 a_2: { $$ = 2; };
   6733 a_5: { $$ = 5; };
   6734 
   6735 sum_of_the_five_previous_values:
   6736     {
   6737        $$ = $<val>0 + $<val>-1 + $<val>-2 + $<val>-3 + $<val>-4;
   6738     }
   6739 ;
   6740 
   6741 %%
   6742 static int
   6743 yylex (void)
   6744 {
   6745   return EOF;
   6746 }
   6747 
   6748 static void
   6749 yyerror (const char *msg)
   6750 {
   6751   fprintf (stderr, "%s\n", msg);
   6752 }
   6753 
   6754 int
   6755 main (void)
   6756 {
   6757   return yyparse ();
   6758 }
   6759 _ATEOF
   6760 
   6761 
   6762 
   6763 $at_traceoff
   6764 echo "actions.at:150: bison -d -v -o input.c input.y"
   6765 echo actions.at:150 >$at_check_line_file
   6766 ( $at_traceon; bison -d -v -o input.c input.y ) >$at_stdout 2>$at_stder1
   6767 at_status=$?
   6768 grep '^ *+' $at_stder1 >&2
   6769 grep -v '^ *+' $at_stder1 >$at_stderr
   6770 at_failed=false
   6771 $at_diff $at_devnull $at_stderr || at_failed=:
   6772 $at_diff $at_devnull $at_stdout || at_failed=:
   6773 case $at_status in
   6774    77) echo 77 > $at_status_file
   6775             exit 77;;
   6776    0) ;;
   6777    *) echo "actions.at:150: exit code was $at_status, expected 0"
   6778       at_failed=:;;
   6779 esac
   6780 if $at_failed; then
   6781 
   6782   echo 1 > $at_status_file
   6783   exit 1
   6784 fi
   6785 
   6786 $at_traceon
   6787 
   6788 $at_traceoff
   6789 echo "actions.at:151: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   6790 echo actions.at:151 >$at_check_line_file
   6791 ( $at_traceon; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >$at_stdout 2>$at_stder1
   6792 at_status=$?
   6793 grep '^ *+' $at_stder1 >&2
   6794 grep -v '^ *+' $at_stder1 >$at_stderr
   6795 at_failed=false
   6796 echo stderr:; cat $at_stderr
   6797 echo stdout:; cat $at_stdout
   6798 case $at_status in
   6799    77) echo 77 > $at_status_file
   6800             exit 77;;
   6801    0) ;;
   6802    *) echo "actions.at:151: exit code was $at_status, expected 0"
   6803       at_failed=:;;
   6804 esac
   6805 if $at_failed; then
   6806 
   6807   echo 1 > $at_status_file
   6808   exit 1
   6809 fi
   6810 
   6811 $at_traceon
   6812 
   6813 $at_traceoff
   6814 echo "actions.at:154: \$PREPARSER ./input"
   6815 echo actions.at:154 >$at_check_line_file
   6816 ( $at_traceon; $PREPARSER ./input ) >$at_stdout 2>$at_stder1
   6817 at_status=$?
   6818 grep '^ *+' $at_stder1 >&2
   6819 grep -v '^ *+' $at_stder1 >$at_stderr
   6820 at_failed=false
   6821 $at_diff $at_devnull $at_stderr || at_failed=:
   6822 echo >>$at_stdout; echo "15
   6823 " | $at_diff - $at_stdout || at_failed=:
   6824 case $at_status in
   6825    77) echo 77 > $at_status_file
   6826             exit 77;;
   6827    0) ;;
   6828    *) echo "actions.at:154: exit code was $at_status, expected 0"
   6829       at_failed=:;;
   6830 esac
   6831 if $at_failed; then
   6832 
   6833   echo 1 > $at_status_file
   6834   exit 1
   6835 fi
   6836 
   6837 $at_traceon
   6838 
   6839 
   6840       $at_traceoff
   6841       $at_times_p && times >$at_times_file
   6842     ) 5>&1 2>&1 | eval $at_tee_pipe
   6843     at_status=`cat $at_status_file`
   6844     ;;
   6845 
   6846   52 ) # 52. actions.at:527: Printers and Destructors :
   6847     at_setup_line='actions.at:527'
   6848     at_desc='Printers and Destructors : '
   6849     $at_quiet $ECHO_N " 52: Printers and Destructors :                   $ECHO_C"
   6850     at_xfail=no
   6851     (
   6852       echo "52. actions.at:527: testing ..."
   6853       $at_traceon
   6854 
   6855 
   6856 
   6857 # Make sure complex $n work.
   6858 
   6859 # Be sure to pass all the %directives to this macro to have correct
   6860 # helping macros.  So don't put any directly in the Bison file.
   6861 
   6862 
   6863 
   6864 
   6865 # Using yacc.c?
   6866 
   6867 
   6868 
   6869 
   6870 
   6871 
   6872 
   6873 # yyerror receives the location if %location & %pure & (%glr or %parse-param).
   6874 
   6875 # yyerror always sees the locations (when activated), except if
   6876 # yacc & pure & !param.
   6877 
   6878 
   6879 # The interface is pure: either because %pure-parser, or because we
   6880 # are using the C++ parsers.
   6881 
   6882 
   6883 
   6884 
   6885 
   6886 
   6887 
   6888 
   6889 
   6890 
   6891 
   6892 cat >input.y <<'_ATEOF'
   6893 %{
   6894 #ifdef HAVE_CONFIG_H
   6895 # include <config.h>
   6896   /* We don't need perfect functions for these tests. */
   6897 # undef malloc
   6898 # undef memcmp
   6899 # undef realloc
   6900 #endif
   6901 %}
   6902 
   6903 %{
   6904 #include <stdio.h>
   6905 #include <stdlib.h>
   6906 #include <assert.h>
   6907 
   6908 #define YYINITDEPTH 10
   6909 #define YYMAXDEPTH 10
   6910 #define RANGE(Location) (Location).first_line, (Location).last_line
   6911 %}
   6912 
   6913 %error-verbose
   6914 %debug
   6915 %verbose
   6916 %locations
   6917 
   6918 
   6919 
   6920 
   6921 %{
   6922 
   6923 static int yylex (void);
   6924 static void yyerror (const char *msg);
   6925 %}
   6926 
   6927 
   6928 
   6929 %printer
   6930   {
   6931     fprintf (yyoutput, "%d", $$);
   6932   }
   6933   input line thing 'x' 'y'
   6934 
   6935 %destructor
   6936   { printf ("Freeing nterm input (%d@%d-%d)\n", $$, RANGE (@$)); }
   6937   input
   6938 
   6939 %destructor
   6940   { printf ("Freeing nterm line (%d@%d-%d)\n", $$, RANGE (@$)); }
   6941   line
   6942 
   6943 %destructor
   6944   { printf ("Freeing nterm thing (%d@%d-%d)\n", $$, RANGE (@$)); }
   6945   thing
   6946 
   6947 %destructor
   6948   { printf ("Freeing token 'x' (%d@%d-%d)\n", $$, RANGE (@$)); }
   6949   'x'
   6950 
   6951 %destructor
   6952   { printf ("Freeing token 'y' (%d@%d-%d)\n", $$, RANGE (@$)); }
   6953   'y'
   6954 
   6955 %%
   6956 /*
   6957    This grammar is made to exercise error recovery.
   6958    "Lines" starting with `(' support error recovery, with
   6959    ')' as synchronizing token.  Lines starting with 'x' can never
   6960    be recovered from if in error.
   6961 */
   6962 
   6963 input:
   6964   /* Nothing. */
   6965     {
   6966       $$ = 0;
   6967       printf ("input (%d@%d-%d): /* Nothing */\n", $$, RANGE (@$));
   6968     }
   6969 | line input /* Right recursive to load the stack so that popping at
   6970 		EOF can	be exercised.  */
   6971     {
   6972       $$ = 2;
   6973       printf ("input (%d@%d-%d): line (%d@%d-%d) input (%d@%d-%d)\n",
   6974 	      $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2));
   6975     }
   6976 ;
   6977 
   6978 line:
   6979   thing thing thing ';'
   6980     {
   6981       $$ = $1;
   6982       printf ("line (%d@%d-%d): thing (%d@%d-%d) thing (%d@%d-%d) thing (%d@%d-%d) ';' (%d@%d-%d)\n",
   6983               $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2),
   6984               $3, RANGE (@3), $4, RANGE (@4));
   6985     }
   6986 | '(' thing thing ')'
   6987     {
   6988       $$ = $1;
   6989       printf ("line (%d@%d-%d): '(' (%d@%d-%d) thing (%d@%d-%d) thing (%d@%d-%d) ')' (%d@%d-%d)\n",
   6990               $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2),
   6991               $3, RANGE (@3), $4, RANGE (@4));
   6992     }
   6993 | '(' thing ')'
   6994     {
   6995       $$ = $1;
   6996       printf ("line (%d@%d-%d): '(' (%d@%d-%d) thing (%d@%d-%d) ')' (%d@%d-%d)\n",
   6997               $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2), $3, RANGE (@3));
   6998     }
   6999 | '(' error ')'
   7000     {
   7001       $$ = -1;
   7002       printf ("line (%d@%d-%d): '(' (%d@%d-%d) error (@%d-%d) ')' (%d@%d-%d)\n",
   7003               $$, RANGE (@$), $1, RANGE (@1), RANGE (@2), $3, RANGE (@3));
   7004     }
   7005 ;
   7006 
   7007 thing:
   7008   'x'
   7009     {
   7010       $$ = $1;
   7011       printf ("thing (%d@%d-%d): 'x' (%d@%d-%d)\n",
   7012               $$, RANGE (@$), $1, RANGE (@1));
   7013     }
   7014 ;
   7015 %%
   7016 /* Alias to ARGV[1]. */
   7017 const char *source = 0;
   7018 
   7019 static int
   7020 yylex (void)
   7021 {
   7022   static unsigned int counter = 0;
   7023 
   7024   int c = (yylval) = counter++;
   7025   /* As in BASIC, line numbers go from 10 to 10.  */
   7026  (yylloc).first_line = (yylloc).first_column = 10 * c;
   7027   (yylloc).last_line = (yylloc).last_column = (yylloc).first_line + 9;
   7028 
   7029 
   7030   if (source[c])
   7031     printf ("sending: '%c'", source[c]);
   7032   else
   7033     printf ("sending: EOF");
   7034   printf (" (%d@%d-%d)\n", c, RANGE ((yylloc)));
   7035   return source[c];
   7036 }
   7037 
   7038 static void
   7039 yyerror (const char *msg)
   7040 {
   7041   printf ("%d-%d: %s\n", RANGE (yylloc), msg);
   7042 }
   7043 
   7044 int
   7045 main (int argc, const char *argv[])
   7046 {
   7047   int status;
   7048   yydebug = !!getenv ("YYDEBUG");
   7049   assert (argc == 2);
   7050   source = argv[1];
   7051   status = yyparse ();
   7052   switch (status)
   7053     {
   7054       case 0: printf ("Successful parse.\n"); break;
   7055       case 1: printf ("Parsing FAILED.\n"); break;
   7056       default: printf ("Parsing FAILED (status %d).\n", status); break;
   7057     }
   7058   return status;
   7059 }
   7060 _ATEOF
   7061 
   7062 
   7063 
   7064 $at_traceoff
   7065 echo "actions.at:527: bison -o input.c input.y"
   7066 echo actions.at:527 >$at_check_line_file
   7067 ( $at_traceon; bison -o input.c input.y ) >$at_stdout 2>$at_stder1
   7068 at_status=$?
   7069 grep '^ *+' $at_stder1 >&2
   7070 grep -v '^ *+' $at_stder1 >$at_stderr
   7071 at_failed=false
   7072 $at_diff $at_devnull $at_stderr || at_failed=:
   7073 $at_diff $at_devnull $at_stdout || at_failed=:
   7074 case $at_status in
   7075    77) echo 77 > $at_status_file
   7076             exit 77;;
   7077    0) ;;
   7078    *) echo "actions.at:527: exit code was $at_status, expected 0"
   7079       at_failed=:;;
   7080 esac
   7081 if $at_failed; then
   7082 
   7083   echo 1 > $at_status_file
   7084   exit 1
   7085 fi
   7086 
   7087 $at_traceon
   7088 
   7089    $at_traceoff
   7090 echo "actions.at:527: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   7091 echo actions.at:527 >$at_check_line_file
   7092 ( $at_traceon; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >$at_stdout 2>$at_stder1
   7093 at_status=$?
   7094 grep '^ *+' $at_stder1 >&2
   7095 grep -v '^ *+' $at_stder1 >$at_stderr
   7096 at_failed=false
   7097 echo stderr:; cat $at_stderr
   7098 echo stdout:; cat $at_stdout
   7099 case $at_status in
   7100    77) echo 77 > $at_status_file
   7101             exit 77;;
   7102    0) ;;
   7103    *) echo "actions.at:527: exit code was $at_status, expected 0"
   7104       at_failed=:;;
   7105 esac
   7106 if $at_failed; then
   7107 
   7108   echo 1 > $at_status_file
   7109   exit 1
   7110 fi
   7111 
   7112 $at_traceon
   7113 
   7114 
   7115 
   7116 # Check the location of "empty"
   7117 # -----------------------------
   7118 # I.e., epsilon-reductions, as in "(x)" which ends by reducing
   7119 # an empty "line" nterm.
   7120 # FIXME: This location is not satisfying.  Depend on the lookahead?
   7121 $at_traceoff
   7122 echo "actions.at:527: \$PREPARSER ./input '(x)'"
   7123 echo actions.at:527 >$at_check_line_file
   7124 ( $at_traceon; $PREPARSER ./input '(x)' ) >$at_stdout 2>$at_stder1
   7125 at_status=$?
   7126 grep '^ *+' $at_stder1 >&2
   7127 grep -v '^ *+' $at_stder1 >$at_stderr
   7128 at_failed=false
   7129 $at_diff $at_devnull $at_stderr || at_failed=:
   7130 echo >>$at_stdout; echo "sending: '(' (0@0-9)
   7131 sending: 'x' (1@10-19)
   7132 thing (1@10-19): 'x' (1@10-19)
   7133 sending: ')' (2@20-29)
   7134 line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
   7135 sending: EOF (3@30-39)
   7136 input (0@29-29): /* Nothing */
   7137 input (2@0-29): line (0@0-29) input (0@29-29)
   7138 Freeing nterm input (2@0-29)
   7139 Successful parse.
   7140 " | $at_diff - $at_stdout || at_failed=:
   7141 case $at_status in
   7142    77) echo 77 > $at_status_file
   7143             exit 77;;
   7144    0) ;;
   7145    *) echo "actions.at:527: exit code was $at_status, expected 0"
   7146       at_failed=:;;
   7147 esac
   7148 if $at_failed; then
   7149 
   7150   echo 1 > $at_status_file
   7151   exit 1
   7152 fi
   7153 
   7154 $at_traceon
   7155 
   7156 
   7157 
   7158 # Check locations in error recovery
   7159 # ---------------------------------
   7160 # '(y)' is an error, but can be recovered from.  But what's the location
   7161 # of the error itself ('y'), and of the resulting reduction ('(error)').
   7162 $at_traceoff
   7163 echo "actions.at:527: \$PREPARSER ./input '(y)'"
   7164 echo actions.at:527 >$at_check_line_file
   7165 ( $at_traceon; $PREPARSER ./input '(y)' ) >$at_stdout 2>$at_stder1
   7166 at_status=$?
   7167 grep '^ *+' $at_stder1 >&2
   7168 grep -v '^ *+' $at_stder1 >$at_stderr
   7169 at_failed=false
   7170 $at_diff $at_devnull $at_stderr || at_failed=:
   7171 echo >>$at_stdout; echo "sending: '(' (0@0-9)
   7172 sending: 'y' (1@10-19)
   7173 10-19: syntax error, unexpected 'y', expecting 'x'
   7174 Freeing token 'y' (1@10-19)
   7175 sending: ')' (2@20-29)
   7176 line (-1@0-29): '(' (0@0-9) error (@10-19) ')' (2@20-29)
   7177 sending: EOF (3@30-39)
   7178 input (0@29-29): /* Nothing */
   7179 input (2@0-29): line (-1@0-29) input (0@29-29)
   7180 Freeing nterm input (2@0-29)
   7181 Successful parse.
   7182 " | $at_diff - $at_stdout || at_failed=:
   7183 case $at_status in
   7184    77) echo 77 > $at_status_file
   7185             exit 77;;
   7186    0) ;;
   7187    *) echo "actions.at:527: exit code was $at_status, expected 0"
   7188       at_failed=:;;
   7189 esac
   7190 if $at_failed; then
   7191 
   7192   echo 1 > $at_status_file
   7193   exit 1
   7194 fi
   7195 
   7196 $at_traceon
   7197 
   7198 
   7199 
   7200 # Syntax errors caught by the parser
   7201 # ----------------------------------
   7202 # Exercise the discarding of stack top and input until `error'
   7203 # can be reduced.
   7204 #
   7205 #     '(', 'x', 'x', 'x', 'x', 'x', ')',
   7206 #
   7207 # Load the stack and provoke an error that cannot be caught by the
   7208 # grammar, to check that the stack is cleared.  And make sure the
   7209 # lookahead is freed.
   7210 #
   7211 #     '(', 'x', ')',
   7212 #     '(', 'x', ')',
   7213 #     'y'
   7214 $at_traceoff
   7215 echo "actions.at:527: \$PREPARSER ./input '(xxxxx)(x)(x)y'"
   7216 echo actions.at:527 >$at_check_line_file
   7217 ( $at_traceon; $PREPARSER ./input '(xxxxx)(x)(x)y' ) >$at_stdout 2>$at_stder1
   7218 at_status=$?
   7219 grep '^ *+' $at_stder1 >&2
   7220 grep -v '^ *+' $at_stder1 >$at_stderr
   7221 at_failed=false
   7222 $at_diff $at_devnull $at_stderr || at_failed=:
   7223 echo >>$at_stdout; echo "sending: '(' (0@0-9)
   7224 sending: 'x' (1@10-19)
   7225 thing (1@10-19): 'x' (1@10-19)
   7226 sending: 'x' (2@20-29)
   7227 thing (2@20-29): 'x' (2@20-29)
   7228 sending: 'x' (3@30-39)
   7229 30-39: syntax error, unexpected 'x', expecting ')'
   7230 Freeing nterm thing (2@20-29)
   7231 Freeing nterm thing (1@10-19)
   7232 Freeing token 'x' (3@30-39)
   7233 sending: 'x' (4@40-49)
   7234 Freeing token 'x' (4@40-49)
   7235 sending: 'x' (5@50-59)
   7236 Freeing token 'x' (5@50-59)
   7237 sending: ')' (6@60-69)
   7238 line (-1@0-69): '(' (0@0-9) error (@10-59) ')' (6@60-69)
   7239 sending: '(' (7@70-79)
   7240 sending: 'x' (8@80-89)
   7241 thing (8@80-89): 'x' (8@80-89)
   7242 sending: ')' (9@90-99)
   7243 line (7@70-99): '(' (7@70-79) thing (8@80-89) ')' (9@90-99)
   7244 sending: '(' (10@100-109)
   7245 sending: 'x' (11@110-119)
   7246 thing (11@110-119): 'x' (11@110-119)
   7247 sending: ')' (12@120-129)
   7248 line (10@100-129): '(' (10@100-109) thing (11@110-119) ')' (12@120-129)
   7249 sending: 'y' (13@130-139)
   7250 input (0@129-129): /* Nothing */
   7251 input (2@100-129): line (10@100-129) input (0@129-129)
   7252 input (2@70-129): line (7@70-99) input (2@100-129)
   7253 input (2@0-129): line (-1@0-69) input (2@70-129)
   7254 130-139: syntax error, unexpected 'y', expecting \$end
   7255 Freeing nterm input (2@0-129)
   7256 Freeing token 'y' (13@130-139)
   7257 Parsing FAILED.
   7258 " | $at_diff - $at_stdout || at_failed=:
   7259 case $at_status in
   7260    77) echo 77 > $at_status_file
   7261             exit 77;;
   7262    1) ;;
   7263    *) echo "actions.at:527: exit code was $at_status, expected 1"
   7264       at_failed=:;;
   7265 esac
   7266 if $at_failed; then
   7267 
   7268   echo 1 > $at_status_file
   7269   exit 1
   7270 fi
   7271 
   7272 $at_traceon
   7273 
   7274 
   7275 # Check destruction upon stack overflow
   7276 # -------------------------------------
   7277 # Upon stack overflow, all symbols on the stack should be destroyed.
   7278 # Only check for yacc.c.
   7279 
   7280 $at_traceoff
   7281 echo "actions.at:527: \$PREPARSER ./input '(x)(x)(x)(x)(x)(x)(x)'"
   7282 echo actions.at:527 >$at_check_line_file
   7283 ( $at_traceon; $PREPARSER ./input '(x)(x)(x)(x)(x)(x)(x)' ) >$at_stdout 2>$at_stder1
   7284 at_status=$?
   7285 grep '^ *+' $at_stder1 >&2
   7286 grep -v '^ *+' $at_stder1 >$at_stderr
   7287 at_failed=false
   7288 $at_diff $at_devnull $at_stderr || at_failed=:
   7289 echo >>$at_stdout; echo "sending: '(' (0@0-9)
   7290 sending: 'x' (1@10-19)
   7291 thing (1@10-19): 'x' (1@10-19)
   7292 sending: ')' (2@20-29)
   7293 line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
   7294 sending: '(' (3@30-39)
   7295 sending: 'x' (4@40-49)
   7296 thing (4@40-49): 'x' (4@40-49)
   7297 sending: ')' (5@50-59)
   7298 line (3@30-59): '(' (3@30-39) thing (4@40-49) ')' (5@50-59)
   7299 sending: '(' (6@60-69)
   7300 sending: 'x' (7@70-79)
   7301 thing (7@70-79): 'x' (7@70-79)
   7302 sending: ')' (8@80-89)
   7303 line (6@60-89): '(' (6@60-69) thing (7@70-79) ')' (8@80-89)
   7304 sending: '(' (9@90-99)
   7305 sending: 'x' (10@100-109)
   7306 thing (10@100-109): 'x' (10@100-109)
   7307 sending: ')' (11@110-119)
   7308 line (9@90-119): '(' (9@90-99) thing (10@100-109) ')' (11@110-119)
   7309 sending: '(' (12@120-129)
   7310 sending: 'x' (13@130-139)
   7311 thing (13@130-139): 'x' (13@130-139)
   7312 sending: ')' (14@140-149)
   7313 line (12@120-149): '(' (12@120-129) thing (13@130-139) ')' (14@140-149)
   7314 sending: '(' (15@150-159)
   7315 sending: 'x' (16@160-169)
   7316 thing (16@160-169): 'x' (16@160-169)
   7317 sending: ')' (17@170-179)
   7318 line (15@150-179): '(' (15@150-159) thing (16@160-169) ')' (17@170-179)
   7319 sending: '(' (18@180-189)
   7320 sending: 'x' (19@190-199)
   7321 thing (19@190-199): 'x' (19@190-199)
   7322 sending: ')' (20@200-209)
   7323 200-209: memory exhausted
   7324 Freeing nterm thing (19@190-199)
   7325 Freeing nterm line (15@150-179)
   7326 Freeing nterm line (12@120-149)
   7327 Freeing nterm line (9@90-119)
   7328 Freeing nterm line (6@60-89)
   7329 Freeing nterm line (3@30-59)
   7330 Freeing nterm line (0@0-29)
   7331 Parsing FAILED (status 2).
   7332 " | $at_diff - $at_stdout || at_failed=:
   7333 case $at_status in
   7334    77) echo 77 > $at_status_file
   7335             exit 77;;
   7336    2) ;;
   7337    *) echo "actions.at:527: exit code was $at_status, expected 2"
   7338       at_failed=:;;
   7339 esac
   7340 if $at_failed; then
   7341 
   7342   echo 1 > $at_status_file
   7343   exit 1
   7344 fi
   7345 
   7346 $at_traceon
   7347 
   7348 
   7349 
   7350 
   7351 
   7352       $at_traceoff
   7353       $at_times_p && times >$at_times_file
   7354     ) 5>&1 2>&1 | eval $at_tee_pipe
   7355     at_status=`cat $at_status_file`
   7356     ;;
   7357 
   7358   53 ) # 53. actions.at:528: Printers and Destructors with union:
   7359     at_setup_line='actions.at:528'
   7360     at_desc='Printers and Destructors with union: '
   7361     $at_quiet $ECHO_N " 53: Printers and Destructors with union:         $ECHO_C"
   7362     at_xfail=no
   7363     (
   7364       echo "53. actions.at:528: testing ..."
   7365       $at_traceon
   7366 
   7367 
   7368 
   7369 # Make sure complex $n work.
   7370 
   7371 # Be sure to pass all the %directives to this macro to have correct
   7372 # helping macros.  So don't put any directly in the Bison file.
   7373 
   7374 
   7375 
   7376 
   7377 # Using yacc.c?
   7378 
   7379 
   7380 
   7381 
   7382 
   7383 
   7384 
   7385 # yyerror receives the location if %location & %pure & (%glr or %parse-param).
   7386 
   7387 # yyerror always sees the locations (when activated), except if
   7388 # yacc & pure & !param.
   7389 
   7390 
   7391 # The interface is pure: either because %pure-parser, or because we
   7392 # are using the C++ parsers.
   7393 
   7394 
   7395 
   7396 
   7397 
   7398 
   7399 
   7400 
   7401 
   7402 
   7403 
   7404 cat >input.y <<'_ATEOF'
   7405 %{
   7406 #ifdef HAVE_CONFIG_H
   7407 # include <config.h>
   7408   /* We don't need perfect functions for these tests. */
   7409 # undef malloc
   7410 # undef memcmp
   7411 # undef realloc
   7412 #endif
   7413 %}
   7414 
   7415 %{
   7416 #include <stdio.h>
   7417 #include <stdlib.h>
   7418 #include <assert.h>
   7419 
   7420 #define YYINITDEPTH 10
   7421 #define YYMAXDEPTH 10
   7422 #define RANGE(Location) (Location).first_line, (Location).last_line
   7423 %}
   7424 
   7425 %error-verbose
   7426 %debug
   7427 %verbose
   7428 %locations
   7429 
   7430 %union
   7431 {
   7432   int ival;
   7433 }
   7434 
   7435 
   7436 %{
   7437 
   7438 static int yylex (void);
   7439 static void yyerror (const char *msg);
   7440 %}
   7441 
   7442 %type <ival> '(' 'x' 'y' ')' ';' thing line input
   7443 
   7444 %printer
   7445   {
   7446     fprintf (yyoutput, "%d", $$);
   7447   }
   7448   input line thing 'x' 'y'
   7449 
   7450 %destructor
   7451   { printf ("Freeing nterm input (%d@%d-%d)\n", $$, RANGE (@$)); }
   7452   input
   7453 
   7454 %destructor
   7455   { printf ("Freeing nterm line (%d@%d-%d)\n", $$, RANGE (@$)); }
   7456   line
   7457 
   7458 %destructor
   7459   { printf ("Freeing nterm thing (%d@%d-%d)\n", $$, RANGE (@$)); }
   7460   thing
   7461 
   7462 %destructor
   7463   { printf ("Freeing token 'x' (%d@%d-%d)\n", $$, RANGE (@$)); }
   7464   'x'
   7465 
   7466 %destructor
   7467   { printf ("Freeing token 'y' (%d@%d-%d)\n", $$, RANGE (@$)); }
   7468   'y'
   7469 
   7470 %%
   7471 /*
   7472    This grammar is made to exercise error recovery.
   7473    "Lines" starting with `(' support error recovery, with
   7474    ')' as synchronizing token.  Lines starting with 'x' can never
   7475    be recovered from if in error.
   7476 */
   7477 
   7478 input:
   7479   /* Nothing. */
   7480     {
   7481       $$ = 0;
   7482       printf ("input (%d@%d-%d): /* Nothing */\n", $$, RANGE (@$));
   7483     }
   7484 | line input /* Right recursive to load the stack so that popping at
   7485 		EOF can	be exercised.  */
   7486     {
   7487       $$ = 2;
   7488       printf ("input (%d@%d-%d): line (%d@%d-%d) input (%d@%d-%d)\n",
   7489 	      $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2));
   7490     }
   7491 ;
   7492 
   7493 line:
   7494   thing thing thing ';'
   7495     {
   7496       $$ = $1;
   7497       printf ("line (%d@%d-%d): thing (%d@%d-%d) thing (%d@%d-%d) thing (%d@%d-%d) ';' (%d@%d-%d)\n",
   7498               $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2),
   7499               $3, RANGE (@3), $4, RANGE (@4));
   7500     }
   7501 | '(' thing thing ')'
   7502     {
   7503       $$ = $1;
   7504       printf ("line (%d@%d-%d): '(' (%d@%d-%d) thing (%d@%d-%d) thing (%d@%d-%d) ')' (%d@%d-%d)\n",
   7505               $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2),
   7506               $3, RANGE (@3), $4, RANGE (@4));
   7507     }
   7508 | '(' thing ')'
   7509     {
   7510       $$ = $1;
   7511       printf ("line (%d@%d-%d): '(' (%d@%d-%d) thing (%d@%d-%d) ')' (%d@%d-%d)\n",
   7512               $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2), $3, RANGE (@3));
   7513     }
   7514 | '(' error ')'
   7515     {
   7516       $$ = -1;
   7517       printf ("line (%d@%d-%d): '(' (%d@%d-%d) error (@%d-%d) ')' (%d@%d-%d)\n",
   7518               $$, RANGE (@$), $1, RANGE (@1), RANGE (@2), $3, RANGE (@3));
   7519     }
   7520 ;
   7521 
   7522 thing:
   7523   'x'
   7524     {
   7525       $$ = $1;
   7526       printf ("thing (%d@%d-%d): 'x' (%d@%d-%d)\n",
   7527               $$, RANGE (@$), $1, RANGE (@1));
   7528     }
   7529 ;
   7530 %%
   7531 /* Alias to ARGV[1]. */
   7532 const char *source = 0;
   7533 
   7534 static int
   7535 yylex (void)
   7536 {
   7537   static unsigned int counter = 0;
   7538 
   7539   int c = (yylval).ival = counter++;
   7540   /* As in BASIC, line numbers go from 10 to 10.  */
   7541  (yylloc).first_line = (yylloc).first_column = 10 * c;
   7542   (yylloc).last_line = (yylloc).last_column = (yylloc).first_line + 9;
   7543 
   7544 
   7545   if (source[c])
   7546     printf ("sending: '%c'", source[c]);
   7547   else
   7548     printf ("sending: EOF");
   7549   printf (" (%d@%d-%d)\n", c, RANGE ((yylloc)));
   7550   return source[c];
   7551 }
   7552 
   7553 static void
   7554 yyerror (const char *msg)
   7555 {
   7556   printf ("%d-%d: %s\n", RANGE (yylloc), msg);
   7557 }
   7558 
   7559 int
   7560 main (int argc, const char *argv[])
   7561 {
   7562   int status;
   7563   yydebug = !!getenv ("YYDEBUG");
   7564   assert (argc == 2);
   7565   source = argv[1];
   7566   status = yyparse ();
   7567   switch (status)
   7568     {
   7569       case 0: printf ("Successful parse.\n"); break;
   7570       case 1: printf ("Parsing FAILED.\n"); break;
   7571       default: printf ("Parsing FAILED (status %d).\n", status); break;
   7572     }
   7573   return status;
   7574 }
   7575 _ATEOF
   7576 
   7577 
   7578 
   7579 $at_traceoff
   7580 echo "actions.at:528: bison -o input.c input.y"
   7581 echo actions.at:528 >$at_check_line_file
   7582 ( $at_traceon; bison -o input.c input.y ) >$at_stdout 2>$at_stder1
   7583 at_status=$?
   7584 grep '^ *+' $at_stder1 >&2
   7585 grep -v '^ *+' $at_stder1 >$at_stderr
   7586 at_failed=false
   7587 $at_diff $at_devnull $at_stderr || at_failed=:
   7588 $at_diff $at_devnull $at_stdout || at_failed=:
   7589 case $at_status in
   7590    77) echo 77 > $at_status_file
   7591             exit 77;;
   7592    0) ;;
   7593    *) echo "actions.at:528: exit code was $at_status, expected 0"
   7594       at_failed=:;;
   7595 esac
   7596 if $at_failed; then
   7597 
   7598   echo 1 > $at_status_file
   7599   exit 1
   7600 fi
   7601 
   7602 $at_traceon
   7603 
   7604    $at_traceoff
   7605 echo "actions.at:528: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   7606 echo actions.at:528 >$at_check_line_file
   7607 ( $at_traceon; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >$at_stdout 2>$at_stder1
   7608 at_status=$?
   7609 grep '^ *+' $at_stder1 >&2
   7610 grep -v '^ *+' $at_stder1 >$at_stderr
   7611 at_failed=false
   7612 echo stderr:; cat $at_stderr
   7613 echo stdout:; cat $at_stdout
   7614 case $at_status in
   7615    77) echo 77 > $at_status_file
   7616             exit 77;;
   7617    0) ;;
   7618    *) echo "actions.at:528: exit code was $at_status, expected 0"
   7619       at_failed=:;;
   7620 esac
   7621 if $at_failed; then
   7622 
   7623   echo 1 > $at_status_file
   7624   exit 1
   7625 fi
   7626 
   7627 $at_traceon
   7628 
   7629 
   7630 
   7631 # Check the location of "empty"
   7632 # -----------------------------
   7633 # I.e., epsilon-reductions, as in "(x)" which ends by reducing
   7634 # an empty "line" nterm.
   7635 # FIXME: This location is not satisfying.  Depend on the lookahead?
   7636 $at_traceoff
   7637 echo "actions.at:528: \$PREPARSER ./input '(x)'"
   7638 echo actions.at:528 >$at_check_line_file
   7639 ( $at_traceon; $PREPARSER ./input '(x)' ) >$at_stdout 2>$at_stder1
   7640 at_status=$?
   7641 grep '^ *+' $at_stder1 >&2
   7642 grep -v '^ *+' $at_stder1 >$at_stderr
   7643 at_failed=false
   7644 $at_diff $at_devnull $at_stderr || at_failed=:
   7645 echo >>$at_stdout; echo "sending: '(' (0@0-9)
   7646 sending: 'x' (1@10-19)
   7647 thing (1@10-19): 'x' (1@10-19)
   7648 sending: ')' (2@20-29)
   7649 line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
   7650 sending: EOF (3@30-39)
   7651 input (0@29-29): /* Nothing */
   7652 input (2@0-29): line (0@0-29) input (0@29-29)
   7653 Freeing nterm input (2@0-29)
   7654 Successful parse.
   7655 " | $at_diff - $at_stdout || at_failed=:
   7656 case $at_status in
   7657    77) echo 77 > $at_status_file
   7658             exit 77;;
   7659    0) ;;
   7660    *) echo "actions.at:528: exit code was $at_status, expected 0"
   7661       at_failed=:;;
   7662 esac
   7663 if $at_failed; then
   7664 
   7665   echo 1 > $at_status_file
   7666   exit 1
   7667 fi
   7668 
   7669 $at_traceon
   7670 
   7671 
   7672 
   7673 # Check locations in error recovery
   7674 # ---------------------------------
   7675 # '(y)' is an error, but can be recovered from.  But what's the location
   7676 # of the error itself ('y'), and of the resulting reduction ('(error)').
   7677 $at_traceoff
   7678 echo "actions.at:528: \$PREPARSER ./input '(y)'"
   7679 echo actions.at:528 >$at_check_line_file
   7680 ( $at_traceon; $PREPARSER ./input '(y)' ) >$at_stdout 2>$at_stder1
   7681 at_status=$?
   7682 grep '^ *+' $at_stder1 >&2
   7683 grep -v '^ *+' $at_stder1 >$at_stderr
   7684 at_failed=false
   7685 $at_diff $at_devnull $at_stderr || at_failed=:
   7686 echo >>$at_stdout; echo "sending: '(' (0@0-9)
   7687 sending: 'y' (1@10-19)
   7688 10-19: syntax error, unexpected 'y', expecting 'x'
   7689 Freeing token 'y' (1@10-19)
   7690 sending: ')' (2@20-29)
   7691 line (-1@0-29): '(' (0@0-9) error (@10-19) ')' (2@20-29)
   7692 sending: EOF (3@30-39)
   7693 input (0@29-29): /* Nothing */
   7694 input (2@0-29): line (-1@0-29) input (0@29-29)
   7695 Freeing nterm input (2@0-29)
   7696 Successful parse.
   7697 " | $at_diff - $at_stdout || at_failed=:
   7698 case $at_status in
   7699    77) echo 77 > $at_status_file
   7700             exit 77;;
   7701    0) ;;
   7702    *) echo "actions.at:528: exit code was $at_status, expected 0"
   7703       at_failed=:;;
   7704 esac
   7705 if $at_failed; then
   7706 
   7707   echo 1 > $at_status_file
   7708   exit 1
   7709 fi
   7710 
   7711 $at_traceon
   7712 
   7713 
   7714 
   7715 # Syntax errors caught by the parser
   7716 # ----------------------------------
   7717 # Exercise the discarding of stack top and input until `error'
   7718 # can be reduced.
   7719 #
   7720 #     '(', 'x', 'x', 'x', 'x', 'x', ')',
   7721 #
   7722 # Load the stack and provoke an error that cannot be caught by the
   7723 # grammar, to check that the stack is cleared.  And make sure the
   7724 # lookahead is freed.
   7725 #
   7726 #     '(', 'x', ')',
   7727 #     '(', 'x', ')',
   7728 #     'y'
   7729 $at_traceoff
   7730 echo "actions.at:528: \$PREPARSER ./input '(xxxxx)(x)(x)y'"
   7731 echo actions.at:528 >$at_check_line_file
   7732 ( $at_traceon; $PREPARSER ./input '(xxxxx)(x)(x)y' ) >$at_stdout 2>$at_stder1
   7733 at_status=$?
   7734 grep '^ *+' $at_stder1 >&2
   7735 grep -v '^ *+' $at_stder1 >$at_stderr
   7736 at_failed=false
   7737 $at_diff $at_devnull $at_stderr || at_failed=:
   7738 echo >>$at_stdout; echo "sending: '(' (0@0-9)
   7739 sending: 'x' (1@10-19)
   7740 thing (1@10-19): 'x' (1@10-19)
   7741 sending: 'x' (2@20-29)
   7742 thing (2@20-29): 'x' (2@20-29)
   7743 sending: 'x' (3@30-39)
   7744 30-39: syntax error, unexpected 'x', expecting ')'
   7745 Freeing nterm thing (2@20-29)
   7746 Freeing nterm thing (1@10-19)
   7747 Freeing token 'x' (3@30-39)
   7748 sending: 'x' (4@40-49)
   7749 Freeing token 'x' (4@40-49)
   7750 sending: 'x' (5@50-59)
   7751 Freeing token 'x' (5@50-59)
   7752 sending: ')' (6@60-69)
   7753 line (-1@0-69): '(' (0@0-9) error (@10-59) ')' (6@60-69)
   7754 sending: '(' (7@70-79)
   7755 sending: 'x' (8@80-89)
   7756 thing (8@80-89): 'x' (8@80-89)
   7757 sending: ')' (9@90-99)
   7758 line (7@70-99): '(' (7@70-79) thing (8@80-89) ')' (9@90-99)
   7759 sending: '(' (10@100-109)
   7760 sending: 'x' (11@110-119)
   7761 thing (11@110-119): 'x' (11@110-119)
   7762 sending: ')' (12@120-129)
   7763 line (10@100-129): '(' (10@100-109) thing (11@110-119) ')' (12@120-129)
   7764 sending: 'y' (13@130-139)
   7765 input (0@129-129): /* Nothing */
   7766 input (2@100-129): line (10@100-129) input (0@129-129)
   7767 input (2@70-129): line (7@70-99) input (2@100-129)
   7768 input (2@0-129): line (-1@0-69) input (2@70-129)
   7769 130-139: syntax error, unexpected 'y', expecting \$end
   7770 Freeing nterm input (2@0-129)
   7771 Freeing token 'y' (13@130-139)
   7772 Parsing FAILED.
   7773 " | $at_diff - $at_stdout || at_failed=:
   7774 case $at_status in
   7775    77) echo 77 > $at_status_file
   7776             exit 77;;
   7777    1) ;;
   7778    *) echo "actions.at:528: exit code was $at_status, expected 1"
   7779       at_failed=:;;
   7780 esac
   7781 if $at_failed; then
   7782 
   7783   echo 1 > $at_status_file
   7784   exit 1
   7785 fi
   7786 
   7787 $at_traceon
   7788 
   7789 
   7790 # Check destruction upon stack overflow
   7791 # -------------------------------------
   7792 # Upon stack overflow, all symbols on the stack should be destroyed.
   7793 # Only check for yacc.c.
   7794 
   7795 $at_traceoff
   7796 echo "actions.at:528: \$PREPARSER ./input '(x)(x)(x)(x)(x)(x)(x)'"
   7797 echo actions.at:528 >$at_check_line_file
   7798 ( $at_traceon; $PREPARSER ./input '(x)(x)(x)(x)(x)(x)(x)' ) >$at_stdout 2>$at_stder1
   7799 at_status=$?
   7800 grep '^ *+' $at_stder1 >&2
   7801 grep -v '^ *+' $at_stder1 >$at_stderr
   7802 at_failed=false
   7803 $at_diff $at_devnull $at_stderr || at_failed=:
   7804 echo >>$at_stdout; echo "sending: '(' (0@0-9)
   7805 sending: 'x' (1@10-19)
   7806 thing (1@10-19): 'x' (1@10-19)
   7807 sending: ')' (2@20-29)
   7808 line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
   7809 sending: '(' (3@30-39)
   7810 sending: 'x' (4@40-49)
   7811 thing (4@40-49): 'x' (4@40-49)
   7812 sending: ')' (5@50-59)
   7813 line (3@30-59): '(' (3@30-39) thing (4@40-49) ')' (5@50-59)
   7814 sending: '(' (6@60-69)
   7815 sending: 'x' (7@70-79)
   7816 thing (7@70-79): 'x' (7@70-79)
   7817 sending: ')' (8@80-89)
   7818 line (6@60-89): '(' (6@60-69) thing (7@70-79) ')' (8@80-89)
   7819 sending: '(' (9@90-99)
   7820 sending: 'x' (10@100-109)
   7821 thing (10@100-109): 'x' (10@100-109)
   7822 sending: ')' (11@110-119)
   7823 line (9@90-119): '(' (9@90-99) thing (10@100-109) ')' (11@110-119)
   7824 sending: '(' (12@120-129)
   7825 sending: 'x' (13@130-139)
   7826 thing (13@130-139): 'x' (13@130-139)
   7827 sending: ')' (14@140-149)
   7828 line (12@120-149): '(' (12@120-129) thing (13@130-139) ')' (14@140-149)
   7829 sending: '(' (15@150-159)
   7830 sending: 'x' (16@160-169)
   7831 thing (16@160-169): 'x' (16@160-169)
   7832 sending: ')' (17@170-179)
   7833 line (15@150-179): '(' (15@150-159) thing (16@160-169) ')' (17@170-179)
   7834 sending: '(' (18@180-189)
   7835 sending: 'x' (19@190-199)
   7836 thing (19@190-199): 'x' (19@190-199)
   7837 sending: ')' (20@200-209)
   7838 200-209: memory exhausted
   7839 Freeing nterm thing (19@190-199)
   7840 Freeing nterm line (15@150-179)
   7841 Freeing nterm line (12@120-149)
   7842 Freeing nterm line (9@90-119)
   7843 Freeing nterm line (6@60-89)
   7844 Freeing nterm line (3@30-59)
   7845 Freeing nterm line (0@0-29)
   7846 Parsing FAILED (status 2).
   7847 " | $at_diff - $at_stdout || at_failed=:
   7848 case $at_status in
   7849    77) echo 77 > $at_status_file
   7850             exit 77;;
   7851    2) ;;
   7852    *) echo "actions.at:528: exit code was $at_status, expected 2"
   7853       at_failed=:;;
   7854 esac
   7855 if $at_failed; then
   7856 
   7857   echo 1 > $at_status_file
   7858   exit 1
   7859 fi
   7860 
   7861 $at_traceon
   7862 
   7863 
   7864 
   7865 
   7866 
   7867       $at_traceoff
   7868       $at_times_p && times >$at_times_file
   7869     ) 5>&1 2>&1 | eval $at_tee_pipe
   7870     at_status=`cat $at_status_file`
   7871     ;;
   7872 
   7873   54 ) # 54. actions.at:533: Printers and Destructors : %defines %skeleton "lalr1.cc"
   7874     at_setup_line='actions.at:533'
   7875     at_desc='Printers and Destructors : %defines %skeleton "lalr1.cc"'
   7876     $at_quiet $ECHO_N " 54: Printers and Destructors : %defines %skeleton "lalr1.cc"$ECHO_C"
   7877     at_xfail=no
   7878     (
   7879       echo "54. actions.at:533: testing ..."
   7880       $at_traceon
   7881 
   7882 
   7883 
   7884 # Make sure complex $n work.
   7885 
   7886 # Be sure to pass all the %directives to this macro to have correct
   7887 # helping macros.  So don't put any directly in the Bison file.
   7888 
   7889 
   7890 
   7891 
   7892 # Using yacc.c?
   7893 
   7894 
   7895 
   7896 
   7897 
   7898 
   7899 
   7900 # yyerror receives the location if %location & %pure & (%glr or %parse-param).
   7901 
   7902 # yyerror always sees the locations (when activated), except if
   7903 # yacc & pure & !param.
   7904 
   7905 
   7906 # The interface is pure: either because %pure-parser, or because we
   7907 # are using the C++ parsers.
   7908 
   7909 
   7910 
   7911 
   7912 
   7913 
   7914 
   7915 
   7916 
   7917 
   7918 
   7919 cat >input.y <<'_ATEOF'
   7920 %{
   7921 #ifdef HAVE_CONFIG_H
   7922 # include <config.h>
   7923   /* We don't need perfect functions for these tests. */
   7924 # undef malloc
   7925 # undef memcmp
   7926 # undef realloc
   7927 #endif
   7928 %}
   7929 
   7930 %{
   7931 #include <stdio.h>
   7932 #include <stdlib.h>
   7933 #include <assert.h>
   7934 
   7935 #define YYINITDEPTH 10
   7936 #define YYMAXDEPTH 10
   7937 #define RANGE(Location) (Location).begin.line, (Location).end.line
   7938 %}
   7939 
   7940 %error-verbose
   7941 %debug
   7942 %verbose
   7943 %locations
   7944 %defines %skeleton "lalr1.cc"
   7945 
   7946 %define "global_tokens_and_yystype"
   7947 
   7948 %{
   7949 typedef yy::location YYLTYPE;
   7950                 #define YYSTYPE int
   7951 static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
   7952 
   7953 %}
   7954 
   7955 
   7956 
   7957 %printer
   7958   {
   7959     debug_stream () << $$;;
   7960   }
   7961   input line thing 'x' 'y'
   7962 
   7963 %destructor
   7964   { printf ("Freeing nterm input (%d@%d-%d)\n", $$, RANGE (@$)); }
   7965   input
   7966 
   7967 %destructor
   7968   { printf ("Freeing nterm line (%d@%d-%d)\n", $$, RANGE (@$)); }
   7969   line
   7970 
   7971 %destructor
   7972   { printf ("Freeing nterm thing (%d@%d-%d)\n", $$, RANGE (@$)); }
   7973   thing
   7974 
   7975 %destructor
   7976   { printf ("Freeing token 'x' (%d@%d-%d)\n", $$, RANGE (@$)); }
   7977   'x'
   7978 
   7979 %destructor
   7980   { printf ("Freeing token 'y' (%d@%d-%d)\n", $$, RANGE (@$)); }
   7981   'y'
   7982 
   7983 %%
   7984 /*
   7985    This grammar is made to exercise error recovery.
   7986    "Lines" starting with `(' support error recovery, with
   7987    ')' as synchronizing token.  Lines starting with 'x' can never
   7988    be recovered from if in error.
   7989 */
   7990 
   7991 input:
   7992   /* Nothing. */
   7993     {
   7994       $$ = 0;
   7995       printf ("input (%d@%d-%d): /* Nothing */\n", $$, RANGE (@$));
   7996     }
   7997 | line input /* Right recursive to load the stack so that popping at
   7998 		EOF can	be exercised.  */
   7999     {
   8000       $$ = 2;
   8001       printf ("input (%d@%d-%d): line (%d@%d-%d) input (%d@%d-%d)\n",
   8002 	      $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2));
   8003     }
   8004 ;
   8005 
   8006 line:
   8007   thing thing thing ';'
   8008     {
   8009       $$ = $1;
   8010       printf ("line (%d@%d-%d): thing (%d@%d-%d) thing (%d@%d-%d) thing (%d@%d-%d) ';' (%d@%d-%d)\n",
   8011               $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2),
   8012               $3, RANGE (@3), $4, RANGE (@4));
   8013     }
   8014 | '(' thing thing ')'
   8015     {
   8016       $$ = $1;
   8017       printf ("line (%d@%d-%d): '(' (%d@%d-%d) thing (%d@%d-%d) thing (%d@%d-%d) ')' (%d@%d-%d)\n",
   8018               $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2),
   8019               $3, RANGE (@3), $4, RANGE (@4));
   8020     }
   8021 | '(' thing ')'
   8022     {
   8023       $$ = $1;
   8024       printf ("line (%d@%d-%d): '(' (%d@%d-%d) thing (%d@%d-%d) ')' (%d@%d-%d)\n",
   8025               $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2), $3, RANGE (@3));
   8026     }
   8027 | '(' error ')'
   8028     {
   8029       $$ = -1;
   8030       printf ("line (%d@%d-%d): '(' (%d@%d-%d) error (@%d-%d) ')' (%d@%d-%d)\n",
   8031               $$, RANGE (@$), $1, RANGE (@1), RANGE (@2), $3, RANGE (@3));
   8032     }
   8033 ;
   8034 
   8035 thing:
   8036   'x'
   8037     {
   8038       $$ = $1;
   8039       printf ("thing (%d@%d-%d): 'x' (%d@%d-%d)\n",
   8040               $$, RANGE (@$), $1, RANGE (@1));
   8041     }
   8042 ;
   8043 %%
   8044 /* Alias to ARGV[1]. */
   8045 const char *source = 0;
   8046 
   8047 static int
   8048 yylex (YYSTYPE *lvalp, YYLTYPE *llocp)
   8049 {
   8050   static unsigned int counter = 0;
   8051 
   8052   int c = (*lvalp) = counter++;
   8053   /* As in BASIC, line numbers go from 10 to 10.  */
   8054  (*llocp).begin.line = (*llocp).begin.column = 10 * c;
   8055   (*llocp).end.line = (*llocp).end.column = (*llocp).begin.line + 9;
   8056 
   8057 
   8058   if (source[c])
   8059     printf ("sending: '%c'", source[c]);
   8060   else
   8061     printf ("sending: EOF");
   8062   printf (" (%d@%d-%d)\n", c, RANGE ((*llocp)));
   8063   return source[c];
   8064 }
   8065 
   8066 /* A C++ error reporting function. */
   8067 void
   8068 yy::parser::error (const location& l, const std::string& m)
   8069 {
   8070   printf ("%d-%d: %s\n", RANGE (l), m.c_str());
   8071 }
   8072 
   8073 static bool yydebug;
   8074 int
   8075 yyparse ()
   8076 {
   8077   yy::parser parser;
   8078   parser.set_debug_level (yydebug);
   8079   return parser.parse ();
   8080 }
   8081 
   8082 
   8083 int
   8084 main (int argc, const char *argv[])
   8085 {
   8086   int status;
   8087   yydebug = !!getenv ("YYDEBUG");
   8088   assert (argc == 2);
   8089   source = argv[1];
   8090   status = yyparse ();
   8091   switch (status)
   8092     {
   8093       case 0: printf ("Successful parse.\n"); break;
   8094       case 1: printf ("Parsing FAILED.\n"); break;
   8095       default: printf ("Parsing FAILED (status %d).\n", status); break;
   8096     }
   8097   return status;
   8098 }
   8099 _ATEOF
   8100 
   8101 
   8102 
   8103 $at_traceoff
   8104 echo "actions.at:533: bison -o input.cc input.y"
   8105 echo actions.at:533 >$at_check_line_file
   8106 ( $at_traceon; bison -o input.cc input.y ) >$at_stdout 2>$at_stder1
   8107 at_status=$?
   8108 grep '^ *+' $at_stder1 >&2
   8109 grep -v '^ *+' $at_stder1 >$at_stderr
   8110 at_failed=false
   8111 $at_diff $at_devnull $at_stderr || at_failed=:
   8112 $at_diff $at_devnull $at_stdout || at_failed=:
   8113 case $at_status in
   8114    77) echo 77 > $at_status_file
   8115             exit 77;;
   8116    0) ;;
   8117    *) echo "actions.at:533: exit code was $at_status, expected 0"
   8118       at_failed=:;;
   8119 esac
   8120 if $at_failed; then
   8121 
   8122   echo 1 > $at_status_file
   8123   exit 1
   8124 fi
   8125 
   8126 $at_traceon
   8127 
   8128 
   8129 $at_traceoff
   8130 echo "actions.at:533: \$BISON_CXX_WORKS"
   8131 echo actions.at:533 >$at_check_line_file
   8132 ( $at_traceon; $BISON_CXX_WORKS ) >$at_stdout 2>$at_stder1
   8133 at_status=$?
   8134 grep '^ *+' $at_stder1 >&2
   8135 grep -v '^ *+' $at_stder1 >$at_stderr
   8136 at_failed=false
   8137 echo stderr:; cat $at_stderr
   8138 echo stdout:; cat $at_stdout
   8139 case $at_status in
   8140    77) echo 77 > $at_status_file
   8141             exit 77;;
   8142    0) ;;
   8143    *) echo "actions.at:533: exit code was $at_status, expected 0"
   8144       at_failed=:;;
   8145 esac
   8146 if $at_failed; then
   8147 
   8148   echo 1 > $at_status_file
   8149   exit 1
   8150 fi
   8151 
   8152 $at_traceon
   8153 
   8154 $at_traceoff
   8155 echo "actions.at:533: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
   8156 echo actions.at:533 >$at_check_line_file
   8157 ( $at_traceon; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS ) >$at_stdout 2>$at_stder1
   8158 at_status=$?
   8159 grep '^ *+' $at_stder1 >&2
   8160 grep -v '^ *+' $at_stder1 >$at_stderr
   8161 at_failed=false
   8162 echo stderr:; cat $at_stderr
   8163 echo stdout:; cat $at_stdout
   8164 case $at_status in
   8165    77) echo 77 > $at_status_file
   8166             exit 77;;
   8167    0) ;;
   8168    *) echo "actions.at:533: exit code was $at_status, expected 0"
   8169       at_failed=:;;
   8170 esac
   8171 if $at_failed; then
   8172 
   8173   echo 1 > $at_status_file
   8174   exit 1
   8175 fi
   8176 
   8177 $at_traceon
   8178 
   8179 
   8180 
   8181 # Check the location of "empty"
   8182 # -----------------------------
   8183 # I.e., epsilon-reductions, as in "(x)" which ends by reducing
   8184 # an empty "line" nterm.
   8185 # FIXME: This location is not satisfying.  Depend on the lookahead?
   8186 $at_traceoff
   8187 echo "actions.at:533: \$PREPARSER ./input '(x)'"
   8188 echo actions.at:533 >$at_check_line_file
   8189 ( $at_traceon; $PREPARSER ./input '(x)' ) >$at_stdout 2>$at_stder1
   8190 at_status=$?
   8191 grep '^ *+' $at_stder1 >&2
   8192 grep -v '^ *+' $at_stder1 >$at_stderr
   8193 at_failed=false
   8194 $at_diff $at_devnull $at_stderr || at_failed=:
   8195 echo >>$at_stdout; echo "sending: '(' (0@0-9)
   8196 sending: 'x' (1@10-19)
   8197 thing (1@10-19): 'x' (1@10-19)
   8198 sending: ')' (2@20-29)
   8199 line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
   8200 sending: EOF (3@30-39)
   8201 input (0@29-29): /* Nothing */
   8202 input (2@0-29): line (0@0-29) input (0@29-29)
   8203 Freeing nterm input (2@0-29)
   8204 Successful parse.
   8205 " | $at_diff - $at_stdout || at_failed=:
   8206 case $at_status in
   8207    77) echo 77 > $at_status_file
   8208             exit 77;;
   8209    0) ;;
   8210    *) echo "actions.at:533: exit code was $at_status, expected 0"
   8211       at_failed=:;;
   8212 esac
   8213 if $at_failed; then
   8214 
   8215   echo 1 > $at_status_file
   8216   exit 1
   8217 fi
   8218 
   8219 $at_traceon
   8220 
   8221 
   8222 
   8223 # Check locations in error recovery
   8224 # ---------------------------------
   8225 # '(y)' is an error, but can be recovered from.  But what's the location
   8226 # of the error itself ('y'), and of the resulting reduction ('(error)').
   8227 $at_traceoff
   8228 echo "actions.at:533: \$PREPARSER ./input '(y)'"
   8229 echo actions.at:533 >$at_check_line_file
   8230 ( $at_traceon; $PREPARSER ./input '(y)' ) >$at_stdout 2>$at_stder1
   8231 at_status=$?
   8232 grep '^ *+' $at_stder1 >&2
   8233 grep -v '^ *+' $at_stder1 >$at_stderr
   8234 at_failed=false
   8235 $at_diff $at_devnull $at_stderr || at_failed=:
   8236 echo >>$at_stdout; echo "sending: '(' (0@0-9)
   8237 sending: 'y' (1@10-19)
   8238 10-19: syntax error, unexpected 'y', expecting 'x'
   8239 Freeing token 'y' (1@10-19)
   8240 sending: ')' (2@20-29)
   8241 line (-1@0-29): '(' (0@0-9) error (@10-19) ')' (2@20-29)
   8242 sending: EOF (3@30-39)
   8243 input (0@29-29): /* Nothing */
   8244 input (2@0-29): line (-1@0-29) input (0@29-29)
   8245 Freeing nterm input (2@0-29)
   8246 Successful parse.
   8247 " | $at_diff - $at_stdout || at_failed=:
   8248 case $at_status in
   8249    77) echo 77 > $at_status_file
   8250             exit 77;;
   8251    0) ;;
   8252    *) echo "actions.at:533: exit code was $at_status, expected 0"
   8253       at_failed=:;;
   8254 esac
   8255 if $at_failed; then
   8256 
   8257   echo 1 > $at_status_file
   8258   exit 1
   8259 fi
   8260 
   8261 $at_traceon
   8262 
   8263 
   8264 
   8265 # Syntax errors caught by the parser
   8266 # ----------------------------------
   8267 # Exercise the discarding of stack top and input until `error'
   8268 # can be reduced.
   8269 #
   8270 #     '(', 'x', 'x', 'x', 'x', 'x', ')',
   8271 #
   8272 # Load the stack and provoke an error that cannot be caught by the
   8273 # grammar, to check that the stack is cleared.  And make sure the
   8274 # lookahead is freed.
   8275 #
   8276 #     '(', 'x', ')',
   8277 #     '(', 'x', ')',
   8278 #     'y'
   8279 $at_traceoff
   8280 echo "actions.at:533: \$PREPARSER ./input '(xxxxx)(x)(x)y'"
   8281 echo actions.at:533 >$at_check_line_file
   8282 ( $at_traceon; $PREPARSER ./input '(xxxxx)(x)(x)y' ) >$at_stdout 2>$at_stder1
   8283 at_status=$?
   8284 grep '^ *+' $at_stder1 >&2
   8285 grep -v '^ *+' $at_stder1 >$at_stderr
   8286 at_failed=false
   8287 $at_diff $at_devnull $at_stderr || at_failed=:
   8288 echo >>$at_stdout; echo "sending: '(' (0@0-9)
   8289 sending: 'x' (1@10-19)
   8290 thing (1@10-19): 'x' (1@10-19)
   8291 sending: 'x' (2@20-29)
   8292 thing (2@20-29): 'x' (2@20-29)
   8293 sending: 'x' (3@30-39)
   8294 30-39: syntax error, unexpected 'x', expecting ')'
   8295 Freeing nterm thing (2@20-29)
   8296 Freeing nterm thing (1@10-19)
   8297 Freeing token 'x' (3@30-39)
   8298 sending: 'x' (4@40-49)
   8299 Freeing token 'x' (4@40-49)
   8300 sending: 'x' (5@50-59)
   8301 Freeing token 'x' (5@50-59)
   8302 sending: ')' (6@60-69)
   8303 line (-1@0-69): '(' (0@0-9) error (@10-59) ')' (6@60-69)
   8304 sending: '(' (7@70-79)
   8305 sending: 'x' (8@80-89)
   8306 thing (8@80-89): 'x' (8@80-89)
   8307 sending: ')' (9@90-99)
   8308 line (7@70-99): '(' (7@70-79) thing (8@80-89) ')' (9@90-99)
   8309 sending: '(' (10@100-109)
   8310 sending: 'x' (11@110-119)
   8311 thing (11@110-119): 'x' (11@110-119)
   8312 sending: ')' (12@120-129)
   8313 line (10@100-129): '(' (10@100-109) thing (11@110-119) ')' (12@120-129)
   8314 sending: 'y' (13@130-139)
   8315 input (0@129-129): /* Nothing */
   8316 input (2@100-129): line (10@100-129) input (0@129-129)
   8317 input (2@70-129): line (7@70-99) input (2@100-129)
   8318 input (2@0-129): line (-1@0-69) input (2@70-129)
   8319 130-139: syntax error, unexpected 'y', expecting \$end
   8320 Freeing nterm input (2@0-129)
   8321 Freeing token 'y' (13@130-139)
   8322 Parsing FAILED.
   8323 " | $at_diff - $at_stdout || at_failed=:
   8324 case $at_status in
   8325    77) echo 77 > $at_status_file
   8326             exit 77;;
   8327    1) ;;
   8328    *) echo "actions.at:533: exit code was $at_status, expected 1"
   8329       at_failed=:;;
   8330 esac
   8331 if $at_failed; then
   8332 
   8333   echo 1 > $at_status_file
   8334   exit 1
   8335 fi
   8336 
   8337 $at_traceon
   8338 
   8339 
   8340 # Check destruction upon stack overflow
   8341 # -------------------------------------
   8342 # Upon stack overflow, all symbols on the stack should be destroyed.
   8343 # Only check for yacc.c.
   8344 
   8345 
   8346 
   8347 
   8348       $at_traceoff
   8349       $at_times_p && times >$at_times_file
   8350     ) 5>&1 2>&1 | eval $at_tee_pipe
   8351     at_status=`cat $at_status_file`
   8352     ;;
   8353 
   8354   55 ) # 55. actions.at:534: Printers and Destructors with union: %defines %skeleton "lalr1.cc"
   8355     at_setup_line='actions.at:534'
   8356     at_desc='Printers and Destructors with union: %defines %skeleton "lalr1.cc"'
   8357     $at_quiet $ECHO_N " 55: Printers and Destructors with union: %defines %skeleton "lalr1.cc"$ECHO_C"
   8358     at_xfail=no
   8359     (
   8360       echo "55. actions.at:534: testing ..."
   8361       $at_traceon
   8362 
   8363 
   8364 
   8365 # Make sure complex $n work.
   8366 
   8367 # Be sure to pass all the %directives to this macro to have correct
   8368 # helping macros.  So don't put any directly in the Bison file.
   8369 
   8370 
   8371 
   8372 
   8373 # Using yacc.c?
   8374 
   8375 
   8376 
   8377 
   8378 
   8379 
   8380 
   8381 # yyerror receives the location if %location & %pure & (%glr or %parse-param).
   8382 
   8383 # yyerror always sees the locations (when activated), except if
   8384 # yacc & pure & !param.
   8385 
   8386 
   8387 # The interface is pure: either because %pure-parser, or because we
   8388 # are using the C++ parsers.
   8389 
   8390 
   8391 
   8392 
   8393 
   8394 
   8395 
   8396 
   8397 
   8398 
   8399 
   8400 cat >input.y <<'_ATEOF'
   8401 %{
   8402 #ifdef HAVE_CONFIG_H
   8403 # include <config.h>
   8404   /* We don't need perfect functions for these tests. */
   8405 # undef malloc
   8406 # undef memcmp
   8407 # undef realloc
   8408 #endif
   8409 %}
   8410 
   8411 %{
   8412 #include <stdio.h>
   8413 #include <stdlib.h>
   8414 #include <assert.h>
   8415 
   8416 #define YYINITDEPTH 10
   8417 #define YYMAXDEPTH 10
   8418 #define RANGE(Location) (Location).begin.line, (Location).end.line
   8419 %}
   8420 
   8421 %error-verbose
   8422 %debug
   8423 %verbose
   8424 %locations
   8425 %defines %skeleton "lalr1.cc"
   8426 %union
   8427 {
   8428   int ival;
   8429 }
   8430 %define "global_tokens_and_yystype"
   8431 
   8432 %{
   8433 typedef yy::location YYLTYPE;
   8434 
   8435 static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
   8436 
   8437 %}
   8438 
   8439 %type <ival> '(' 'x' 'y' ')' ';' thing line input
   8440 
   8441 %printer
   8442   {
   8443     debug_stream () << $$;;
   8444   }
   8445   input line thing 'x' 'y'
   8446 
   8447 %destructor
   8448   { printf ("Freeing nterm input (%d@%d-%d)\n", $$, RANGE (@$)); }
   8449   input
   8450 
   8451 %destructor
   8452   { printf ("Freeing nterm line (%d@%d-%d)\n", $$, RANGE (@$)); }
   8453   line
   8454 
   8455 %destructor
   8456   { printf ("Freeing nterm thing (%d@%d-%d)\n", $$, RANGE (@$)); }
   8457   thing
   8458 
   8459 %destructor
   8460   { printf ("Freeing token 'x' (%d@%d-%d)\n", $$, RANGE (@$)); }
   8461   'x'
   8462 
   8463 %destructor
   8464   { printf ("Freeing token 'y' (%d@%d-%d)\n", $$, RANGE (@$)); }
   8465   'y'
   8466 
   8467 %%
   8468 /*
   8469    This grammar is made to exercise error recovery.
   8470    "Lines" starting with `(' support error recovery, with
   8471    ')' as synchronizing token.  Lines starting with 'x' can never
   8472    be recovered from if in error.
   8473 */
   8474 
   8475 input:
   8476   /* Nothing. */
   8477     {
   8478       $$ = 0;
   8479       printf ("input (%d@%d-%d): /* Nothing */\n", $$, RANGE (@$));
   8480     }
   8481 | line input /* Right recursive to load the stack so that popping at
   8482 		EOF can	be exercised.  */
   8483     {
   8484       $$ = 2;
   8485       printf ("input (%d@%d-%d): line (%d@%d-%d) input (%d@%d-%d)\n",
   8486 	      $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2));
   8487     }
   8488 ;
   8489 
   8490 line:
   8491   thing thing thing ';'
   8492     {
   8493       $$ = $1;
   8494       printf ("line (%d@%d-%d): thing (%d@%d-%d) thing (%d@%d-%d) thing (%d@%d-%d) ';' (%d@%d-%d)\n",
   8495               $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2),
   8496               $3, RANGE (@3), $4, RANGE (@4));
   8497     }
   8498 | '(' thing thing ')'
   8499     {
   8500       $$ = $1;
   8501       printf ("line (%d@%d-%d): '(' (%d@%d-%d) thing (%d@%d-%d) thing (%d@%d-%d) ')' (%d@%d-%d)\n",
   8502               $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2),
   8503               $3, RANGE (@3), $4, RANGE (@4));
   8504     }
   8505 | '(' thing ')'
   8506     {
   8507       $$ = $1;
   8508       printf ("line (%d@%d-%d): '(' (%d@%d-%d) thing (%d@%d-%d) ')' (%d@%d-%d)\n",
   8509               $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2), $3, RANGE (@3));
   8510     }
   8511 | '(' error ')'
   8512     {
   8513       $$ = -1;
   8514       printf ("line (%d@%d-%d): '(' (%d@%d-%d) error (@%d-%d) ')' (%d@%d-%d)\n",
   8515               $$, RANGE (@$), $1, RANGE (@1), RANGE (@2), $3, RANGE (@3));
   8516     }
   8517 ;
   8518 
   8519 thing:
   8520   'x'
   8521     {
   8522       $$ = $1;
   8523       printf ("thing (%d@%d-%d): 'x' (%d@%d-%d)\n",
   8524               $$, RANGE (@$), $1, RANGE (@1));
   8525     }
   8526 ;
   8527 %%
   8528 /* Alias to ARGV[1]. */
   8529 const char *source = 0;
   8530 
   8531 static int
   8532 yylex (YYSTYPE *lvalp, YYLTYPE *llocp)
   8533 {
   8534   static unsigned int counter = 0;
   8535 
   8536   int c = (*lvalp).ival = counter++;
   8537   /* As in BASIC, line numbers go from 10 to 10.  */
   8538  (*llocp).begin.line = (*llocp).begin.column = 10 * c;
   8539   (*llocp).end.line = (*llocp).end.column = (*llocp).begin.line + 9;
   8540 
   8541 
   8542   if (source[c])
   8543     printf ("sending: '%c'", source[c]);
   8544   else
   8545     printf ("sending: EOF");
   8546   printf (" (%d@%d-%d)\n", c, RANGE ((*llocp)));
   8547   return source[c];
   8548 }
   8549 
   8550 /* A C++ error reporting function. */
   8551 void
   8552 yy::parser::error (const location& l, const std::string& m)
   8553 {
   8554   printf ("%d-%d: %s\n", RANGE (l), m.c_str());
   8555 }
   8556 
   8557 static bool yydebug;
   8558 int
   8559 yyparse ()
   8560 {
   8561   yy::parser parser;
   8562   parser.set_debug_level (yydebug);
   8563   return parser.parse ();
   8564 }
   8565 
   8566 
   8567 int
   8568 main (int argc, const char *argv[])
   8569 {
   8570   int status;
   8571   yydebug = !!getenv ("YYDEBUG");
   8572   assert (argc == 2);
   8573   source = argv[1];
   8574   status = yyparse ();
   8575   switch (status)
   8576     {
   8577       case 0: printf ("Successful parse.\n"); break;
   8578       case 1: printf ("Parsing FAILED.\n"); break;
   8579       default: printf ("Parsing FAILED (status %d).\n", status); break;
   8580     }
   8581   return status;
   8582 }
   8583 _ATEOF
   8584 
   8585 
   8586 
   8587 $at_traceoff
   8588 echo "actions.at:534: bison -o input.cc input.y"
   8589 echo actions.at:534 >$at_check_line_file
   8590 ( $at_traceon; bison -o input.cc input.y ) >$at_stdout 2>$at_stder1
   8591 at_status=$?
   8592 grep '^ *+' $at_stder1 >&2
   8593 grep -v '^ *+' $at_stder1 >$at_stderr
   8594 at_failed=false
   8595 $at_diff $at_devnull $at_stderr || at_failed=:
   8596 $at_diff $at_devnull $at_stdout || at_failed=:
   8597 case $at_status in
   8598    77) echo 77 > $at_status_file
   8599             exit 77;;
   8600    0) ;;
   8601    *) echo "actions.at:534: exit code was $at_status, expected 0"
   8602       at_failed=:;;
   8603 esac
   8604 if $at_failed; then
   8605 
   8606   echo 1 > $at_status_file
   8607   exit 1
   8608 fi
   8609 
   8610 $at_traceon
   8611 
   8612 
   8613 $at_traceoff
   8614 echo "actions.at:534: \$BISON_CXX_WORKS"
   8615 echo actions.at:534 >$at_check_line_file
   8616 ( $at_traceon; $BISON_CXX_WORKS ) >$at_stdout 2>$at_stder1
   8617 at_status=$?
   8618 grep '^ *+' $at_stder1 >&2
   8619 grep -v '^ *+' $at_stder1 >$at_stderr
   8620 at_failed=false
   8621 echo stderr:; cat $at_stderr
   8622 echo stdout:; cat $at_stdout
   8623 case $at_status in
   8624    77) echo 77 > $at_status_file
   8625             exit 77;;
   8626    0) ;;
   8627    *) echo "actions.at:534: exit code was $at_status, expected 0"
   8628       at_failed=:;;
   8629 esac
   8630 if $at_failed; then
   8631 
   8632   echo 1 > $at_status_file
   8633   exit 1
   8634 fi
   8635 
   8636 $at_traceon
   8637 
   8638 $at_traceoff
   8639 echo "actions.at:534: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
   8640 echo actions.at:534 >$at_check_line_file
   8641 ( $at_traceon; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS ) >$at_stdout 2>$at_stder1
   8642 at_status=$?
   8643 grep '^ *+' $at_stder1 >&2
   8644 grep -v '^ *+' $at_stder1 >$at_stderr
   8645 at_failed=false
   8646 echo stderr:; cat $at_stderr
   8647 echo stdout:; cat $at_stdout
   8648 case $at_status in
   8649    77) echo 77 > $at_status_file
   8650             exit 77;;
   8651    0) ;;
   8652    *) echo "actions.at:534: exit code was $at_status, expected 0"
   8653       at_failed=:;;
   8654 esac
   8655 if $at_failed; then
   8656 
   8657   echo 1 > $at_status_file
   8658   exit 1
   8659 fi
   8660 
   8661 $at_traceon
   8662 
   8663 
   8664 
   8665 # Check the location of "empty"
   8666 # -----------------------------
   8667 # I.e., epsilon-reductions, as in "(x)" which ends by reducing
   8668 # an empty "line" nterm.
   8669 # FIXME: This location is not satisfying.  Depend on the lookahead?
   8670 $at_traceoff
   8671 echo "actions.at:534: \$PREPARSER ./input '(x)'"
   8672 echo actions.at:534 >$at_check_line_file
   8673 ( $at_traceon; $PREPARSER ./input '(x)' ) >$at_stdout 2>$at_stder1
   8674 at_status=$?
   8675 grep '^ *+' $at_stder1 >&2
   8676 grep -v '^ *+' $at_stder1 >$at_stderr
   8677 at_failed=false
   8678 $at_diff $at_devnull $at_stderr || at_failed=:
   8679 echo >>$at_stdout; echo "sending: '(' (0@0-9)
   8680 sending: 'x' (1@10-19)
   8681 thing (1@10-19): 'x' (1@10-19)
   8682 sending: ')' (2@20-29)
   8683 line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
   8684 sending: EOF (3@30-39)
   8685 input (0@29-29): /* Nothing */
   8686 input (2@0-29): line (0@0-29) input (0@29-29)
   8687 Freeing nterm input (2@0-29)
   8688 Successful parse.
   8689 " | $at_diff - $at_stdout || at_failed=:
   8690 case $at_status in
   8691    77) echo 77 > $at_status_file
   8692             exit 77;;
   8693    0) ;;
   8694    *) echo "actions.at:534: exit code was $at_status, expected 0"
   8695       at_failed=:;;
   8696 esac
   8697 if $at_failed; then
   8698 
   8699   echo 1 > $at_status_file
   8700   exit 1
   8701 fi
   8702 
   8703 $at_traceon
   8704 
   8705 
   8706 
   8707 # Check locations in error recovery
   8708 # ---------------------------------
   8709 # '(y)' is an error, but can be recovered from.  But what's the location
   8710 # of the error itself ('y'), and of the resulting reduction ('(error)').
   8711 $at_traceoff
   8712 echo "actions.at:534: \$PREPARSER ./input '(y)'"
   8713 echo actions.at:534 >$at_check_line_file
   8714 ( $at_traceon; $PREPARSER ./input '(y)' ) >$at_stdout 2>$at_stder1
   8715 at_status=$?
   8716 grep '^ *+' $at_stder1 >&2
   8717 grep -v '^ *+' $at_stder1 >$at_stderr
   8718 at_failed=false
   8719 $at_diff $at_devnull $at_stderr || at_failed=:
   8720 echo >>$at_stdout; echo "sending: '(' (0@0-9)
   8721 sending: 'y' (1@10-19)
   8722 10-19: syntax error, unexpected 'y', expecting 'x'
   8723 Freeing token 'y' (1@10-19)
   8724 sending: ')' (2@20-29)
   8725 line (-1@0-29): '(' (0@0-9) error (@10-19) ')' (2@20-29)
   8726 sending: EOF (3@30-39)
   8727 input (0@29-29): /* Nothing */
   8728 input (2@0-29): line (-1@0-29) input (0@29-29)
   8729 Freeing nterm input (2@0-29)
   8730 Successful parse.
   8731 " | $at_diff - $at_stdout || at_failed=:
   8732 case $at_status in
   8733    77) echo 77 > $at_status_file
   8734             exit 77;;
   8735    0) ;;
   8736    *) echo "actions.at:534: exit code was $at_status, expected 0"
   8737       at_failed=:;;
   8738 esac
   8739 if $at_failed; then
   8740 
   8741   echo 1 > $at_status_file
   8742   exit 1
   8743 fi
   8744 
   8745 $at_traceon
   8746 
   8747 
   8748 
   8749 # Syntax errors caught by the parser
   8750 # ----------------------------------
   8751 # Exercise the discarding of stack top and input until `error'
   8752 # can be reduced.
   8753 #
   8754 #     '(', 'x', 'x', 'x', 'x', 'x', ')',
   8755 #
   8756 # Load the stack and provoke an error that cannot be caught by the
   8757 # grammar, to check that the stack is cleared.  And make sure the
   8758 # lookahead is freed.
   8759 #
   8760 #     '(', 'x', ')',
   8761 #     '(', 'x', ')',
   8762 #     'y'
   8763 $at_traceoff
   8764 echo "actions.at:534: \$PREPARSER ./input '(xxxxx)(x)(x)y'"
   8765 echo actions.at:534 >$at_check_line_file
   8766 ( $at_traceon; $PREPARSER ./input '(xxxxx)(x)(x)y' ) >$at_stdout 2>$at_stder1
   8767 at_status=$?
   8768 grep '^ *+' $at_stder1 >&2
   8769 grep -v '^ *+' $at_stder1 >$at_stderr
   8770 at_failed=false
   8771 $at_diff $at_devnull $at_stderr || at_failed=:
   8772 echo >>$at_stdout; echo "sending: '(' (0@0-9)
   8773 sending: 'x' (1@10-19)
   8774 thing (1@10-19): 'x' (1@10-19)
   8775 sending: 'x' (2@20-29)
   8776 thing (2@20-29): 'x' (2@20-29)
   8777 sending: 'x' (3@30-39)
   8778 30-39: syntax error, unexpected 'x', expecting ')'
   8779 Freeing nterm thing (2@20-29)
   8780 Freeing nterm thing (1@10-19)
   8781 Freeing token 'x' (3@30-39)
   8782 sending: 'x' (4@40-49)
   8783 Freeing token 'x' (4@40-49)
   8784 sending: 'x' (5@50-59)
   8785 Freeing token 'x' (5@50-59)
   8786 sending: ')' (6@60-69)
   8787 line (-1@0-69): '(' (0@0-9) error (@10-59) ')' (6@60-69)
   8788 sending: '(' (7@70-79)
   8789 sending: 'x' (8@80-89)
   8790 thing (8@80-89): 'x' (8@80-89)
   8791 sending: ')' (9@90-99)
   8792 line (7@70-99): '(' (7@70-79) thing (8@80-89) ')' (9@90-99)
   8793 sending: '(' (10@100-109)
   8794 sending: 'x' (11@110-119)
   8795 thing (11@110-119): 'x' (11@110-119)
   8796 sending: ')' (12@120-129)
   8797 line (10@100-129): '(' (10@100-109) thing (11@110-119) ')' (12@120-129)
   8798 sending: 'y' (13@130-139)
   8799 input (0@129-129): /* Nothing */
   8800 input (2@100-129): line (10@100-129) input (0@129-129)
   8801 input (2@70-129): line (7@70-99) input (2@100-129)
   8802 input (2@0-129): line (-1@0-69) input (2@70-129)
   8803 130-139: syntax error, unexpected 'y', expecting \$end
   8804 Freeing nterm input (2@0-129)
   8805 Freeing token 'y' (13@130-139)
   8806 Parsing FAILED.
   8807 " | $at_diff - $at_stdout || at_failed=:
   8808 case $at_status in
   8809    77) echo 77 > $at_status_file
   8810             exit 77;;
   8811    1) ;;
   8812    *) echo "actions.at:534: exit code was $at_status, expected 1"
   8813       at_failed=:;;
   8814 esac
   8815 if $at_failed; then
   8816 
   8817   echo 1 > $at_status_file
   8818   exit 1
   8819 fi
   8820 
   8821 $at_traceon
   8822 
   8823 
   8824 # Check destruction upon stack overflow
   8825 # -------------------------------------
   8826 # Upon stack overflow, all symbols on the stack should be destroyed.
   8827 # Only check for yacc.c.
   8828 
   8829 
   8830 
   8831 
   8832       $at_traceoff
   8833       $at_times_p && times >$at_times_file
   8834     ) 5>&1 2>&1 | eval $at_tee_pipe
   8835     at_status=`cat $at_status_file`
   8836     ;;
   8837 
   8838   56 ) # 56. actions.at:536: Printers and Destructors : %glr-parser
   8839     at_setup_line='actions.at:536'
   8840     at_desc='Printers and Destructors : %glr-parser'
   8841     $at_quiet $ECHO_N " 56: Printers and Destructors : %glr-parser       $ECHO_C"
   8842     at_xfail=no
   8843     (
   8844       echo "56. actions.at:536: testing ..."
   8845       $at_traceon
   8846 
   8847 
   8848 
   8849 # Make sure complex $n work.
   8850 
   8851 # Be sure to pass all the %directives to this macro to have correct
   8852 # helping macros.  So don't put any directly in the Bison file.
   8853 
   8854 
   8855 
   8856 
   8857 # Using yacc.c?
   8858 
   8859 
   8860 
   8861 
   8862 
   8863 
   8864 
   8865 # yyerror receives the location if %location & %pure & (%glr or %parse-param).
   8866 
   8867 # yyerror always sees the locations (when activated), except if
   8868 # yacc & pure & !param.
   8869 
   8870 
   8871 # The interface is pure: either because %pure-parser, or because we
   8872 # are using the C++ parsers.
   8873 
   8874 
   8875 
   8876 
   8877 
   8878 
   8879 
   8880 
   8881 
   8882 
   8883 
   8884 cat >input.y <<'_ATEOF'
   8885 %{
   8886 #ifdef HAVE_CONFIG_H
   8887 # include <config.h>
   8888   /* We don't need perfect functions for these tests. */
   8889 # undef malloc
   8890 # undef memcmp
   8891 # undef realloc
   8892 #endif
   8893 %}
   8894 
   8895 %{
   8896 #include <stdio.h>
   8897 #include <stdlib.h>
   8898 #include <assert.h>
   8899 
   8900 #define YYINITDEPTH 10
   8901 #define YYMAXDEPTH 10
   8902 #define RANGE(Location) (Location).first_line, (Location).last_line
   8903 %}
   8904 
   8905 %error-verbose
   8906 %debug
   8907 %verbose
   8908 %locations
   8909 %glr-parser
   8910 
   8911 
   8912 
   8913 %{
   8914 
   8915 static int yylex (void);
   8916 static void yyerror (const char *msg);
   8917 %}
   8918 
   8919 
   8920 
   8921 %printer
   8922   {
   8923     fprintf (yyoutput, "%d", $$);
   8924   }
   8925   input line thing 'x' 'y'
   8926 
   8927 %destructor
   8928   { printf ("Freeing nterm input (%d@%d-%d)\n", $$, RANGE (@$)); }
   8929   input
   8930 
   8931 %destructor
   8932   { printf ("Freeing nterm line (%d@%d-%d)\n", $$, RANGE (@$)); }
   8933   line
   8934 
   8935 %destructor
   8936   { printf ("Freeing nterm thing (%d@%d-%d)\n", $$, RANGE (@$)); }
   8937   thing
   8938 
   8939 %destructor
   8940   { printf ("Freeing token 'x' (%d@%d-%d)\n", $$, RANGE (@$)); }
   8941   'x'
   8942 
   8943 %destructor
   8944   { printf ("Freeing token 'y' (%d@%d-%d)\n", $$, RANGE (@$)); }
   8945   'y'
   8946 
   8947 %%
   8948 /*
   8949    This grammar is made to exercise error recovery.
   8950    "Lines" starting with `(' support error recovery, with
   8951    ')' as synchronizing token.  Lines starting with 'x' can never
   8952    be recovered from if in error.
   8953 */
   8954 
   8955 input:
   8956   /* Nothing. */
   8957     {
   8958       $$ = 0;
   8959       printf ("input (%d@%d-%d): /* Nothing */\n", $$, RANGE (@$));
   8960     }
   8961 | line input /* Right recursive to load the stack so that popping at
   8962 		EOF can	be exercised.  */
   8963     {
   8964       $$ = 2;
   8965       printf ("input (%d@%d-%d): line (%d@%d-%d) input (%d@%d-%d)\n",
   8966 	      $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2));
   8967     }
   8968 ;
   8969 
   8970 line:
   8971   thing thing thing ';'
   8972     {
   8973       $$ = $1;
   8974       printf ("line (%d@%d-%d): thing (%d@%d-%d) thing (%d@%d-%d) thing (%d@%d-%d) ';' (%d@%d-%d)\n",
   8975               $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2),
   8976               $3, RANGE (@3), $4, RANGE (@4));
   8977     }
   8978 | '(' thing thing ')'
   8979     {
   8980       $$ = $1;
   8981       printf ("line (%d@%d-%d): '(' (%d@%d-%d) thing (%d@%d-%d) thing (%d@%d-%d) ')' (%d@%d-%d)\n",
   8982               $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2),
   8983               $3, RANGE (@3), $4, RANGE (@4));
   8984     }
   8985 | '(' thing ')'
   8986     {
   8987       $$ = $1;
   8988       printf ("line (%d@%d-%d): '(' (%d@%d-%d) thing (%d@%d-%d) ')' (%d@%d-%d)\n",
   8989               $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2), $3, RANGE (@3));
   8990     }
   8991 | '(' error ')'
   8992     {
   8993       $$ = -1;
   8994       printf ("line (%d@%d-%d): '(' (%d@%d-%d) error (@%d-%d) ')' (%d@%d-%d)\n",
   8995               $$, RANGE (@$), $1, RANGE (@1), RANGE (@2), $3, RANGE (@3));
   8996     }
   8997 ;
   8998 
   8999 thing:
   9000   'x'
   9001     {
   9002       $$ = $1;
   9003       printf ("thing (%d@%d-%d): 'x' (%d@%d-%d)\n",
   9004               $$, RANGE (@$), $1, RANGE (@1));
   9005     }
   9006 ;
   9007 %%
   9008 /* Alias to ARGV[1]. */
   9009 const char *source = 0;
   9010 
   9011 static int
   9012 yylex (void)
   9013 {
   9014   static unsigned int counter = 0;
   9015 
   9016   int c = (yylval) = counter++;
   9017   /* As in BASIC, line numbers go from 10 to 10.  */
   9018  (yylloc).first_line = (yylloc).first_column = 10 * c;
   9019   (yylloc).last_line = (yylloc).last_column = (yylloc).first_line + 9;
   9020 
   9021 
   9022   if (source[c])
   9023     printf ("sending: '%c'", source[c]);
   9024   else
   9025     printf ("sending: EOF");
   9026   printf (" (%d@%d-%d)\n", c, RANGE ((yylloc)));
   9027   return source[c];
   9028 }
   9029 
   9030 static void
   9031 yyerror (const char *msg)
   9032 {
   9033   printf ("%d-%d: %s\n", RANGE (yylloc), msg);
   9034 }
   9035 
   9036 int
   9037 main (int argc, const char *argv[])
   9038 {
   9039   int status;
   9040   yydebug = !!getenv ("YYDEBUG");
   9041   assert (argc == 2);
   9042   source = argv[1];
   9043   status = yyparse ();
   9044   switch (status)
   9045     {
   9046       case 0: printf ("Successful parse.\n"); break;
   9047       case 1: printf ("Parsing FAILED.\n"); break;
   9048       default: printf ("Parsing FAILED (status %d).\n", status); break;
   9049     }
   9050   return status;
   9051 }
   9052 _ATEOF
   9053 
   9054 
   9055 
   9056 $at_traceoff
   9057 echo "actions.at:536: bison -o input.c input.y"
   9058 echo actions.at:536 >$at_check_line_file
   9059 ( $at_traceon; bison -o input.c input.y ) >$at_stdout 2>$at_stder1
   9060 at_status=$?
   9061 grep '^ *+' $at_stder1 >&2
   9062 grep -v '^ *+' $at_stder1 >$at_stderr
   9063 at_failed=false
   9064 $at_diff $at_devnull $at_stderr || at_failed=:
   9065 $at_diff $at_devnull $at_stdout || at_failed=:
   9066 case $at_status in
   9067    77) echo 77 > $at_status_file
   9068             exit 77;;
   9069    0) ;;
   9070    *) echo "actions.at:536: exit code was $at_status, expected 0"
   9071       at_failed=:;;
   9072 esac
   9073 if $at_failed; then
   9074 
   9075   echo 1 > $at_status_file
   9076   exit 1
   9077 fi
   9078 
   9079 $at_traceon
   9080 
   9081    $at_traceoff
   9082 echo "actions.at:536: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
   9083 echo actions.at:536 >$at_check_line_file
   9084 ( $at_traceon; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >$at_stdout 2>$at_stder1
   9085 at_status=$?
   9086 grep '^ *+' $at_stder1 >&2
   9087 grep -v '^ *+' $at_stder1 >$at_stderr
   9088 at_failed=false
   9089 echo stderr:; cat $at_stderr
   9090 echo stdout:; cat $at_stdout
   9091 case $at_status in
   9092    77) echo 77 > $at_status_file
   9093             exit 77;;
   9094    0) ;;
   9095    *) echo "actions.at:536: exit code was $at_status, expected 0"
   9096       at_failed=:;;
   9097 esac
   9098 if $at_failed; then
   9099 
   9100   echo 1 > $at_status_file
   9101   exit 1
   9102 fi
   9103 
   9104 $at_traceon
   9105 
   9106 
   9107 
   9108 # Check the location of "empty"
   9109 # -----------------------------
   9110 # I.e., epsilon-reductions, as in "(x)" which ends by reducing
   9111 # an empty "line" nterm.
   9112 # FIXME: This location is not satisfying.  Depend on the lookahead?
   9113 $at_traceoff
   9114 echo "actions.at:536: \$PREPARSER ./input '(x)'"
   9115 echo actions.at:536 >$at_check_line_file
   9116 ( $at_traceon; $PREPARSER ./input '(x)' ) >$at_stdout 2>$at_stder1
   9117 at_status=$?
   9118 grep '^ *+' $at_stder1 >&2
   9119 grep -v '^ *+' $at_stder1 >$at_stderr
   9120 at_failed=false
   9121 $at_diff $at_devnull $at_stderr || at_failed=:
   9122 echo >>$at_stdout; echo "sending: '(' (0@0-9)
   9123 sending: 'x' (1@10-19)
   9124 thing (1@10-19): 'x' (1@10-19)
   9125 sending: ')' (2@20-29)
   9126 line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
   9127 sending: EOF (3@30-39)
   9128 input (0@29-29): /* Nothing */
   9129 input (2@0-29): line (0@0-29) input (0@29-29)
   9130 Freeing nterm input (2@0-29)
   9131 Successful parse.
   9132 " | $at_diff - $at_stdout || at_failed=:
   9133 case $at_status in
   9134    77) echo 77 > $at_status_file
   9135             exit 77;;
   9136    0) ;;
   9137    *) echo "actions.at:536: exit code was $at_status, expected 0"
   9138       at_failed=:;;
   9139 esac
   9140 if $at_failed; then
   9141 
   9142   echo 1 > $at_status_file
   9143   exit 1
   9144 fi
   9145 
   9146 $at_traceon
   9147 
   9148 
   9149 
   9150 # Check locations in error recovery
   9151 # ---------------------------------
   9152 # '(y)' is an error, but can be recovered from.  But what's the location
   9153 # of the error itself ('y'), and of the resulting reduction ('(error)').
   9154 $at_traceoff
   9155 echo "actions.at:536: \$PREPARSER ./input '(y)'"
   9156 echo actions.at:536 >$at_check_line_file
   9157 ( $at_traceon; $PREPARSER ./input '(y)' ) >$at_stdout 2>$at_stder1
   9158 at_status=$?
   9159 grep '^ *+' $at_stder1 >&2
   9160 grep -v '^ *+' $at_stder1 >$at_stderr
   9161 at_failed=false
   9162 $at_diff $at_devnull $at_stderr || at_failed=:
   9163 echo >>$at_stdout; echo "sending: '(' (0@0-9)
   9164 sending: 'y' (1@10-19)
   9165 10-19: syntax error, unexpected 'y', expecting 'x'
   9166 Freeing token 'y' (1@10-19)
   9167 sending: ')' (2@20-29)
   9168 line (-1@0-29): '(' (0@0-9) error (@10-19) ')' (2@20-29)
   9169 sending: EOF (3@30-39)
   9170 input (0@29-29): /* Nothing */
   9171 input (2@0-29): line (-1@0-29) input (0@29-29)
   9172 Freeing nterm input (2@0-29)
   9173 Successful parse.
   9174 " | $at_diff - $at_stdout || at_failed=:
   9175 case $at_status in
   9176    77) echo 77 > $at_status_file
   9177             exit 77;;
   9178    0) ;;
   9179    *) echo "actions.at:536: exit code was $at_status, expected 0"
   9180       at_failed=:;;
   9181 esac
   9182 if $at_failed; then
   9183 
   9184   echo 1 > $at_status_file
   9185   exit 1
   9186 fi
   9187 
   9188 $at_traceon
   9189 
   9190 
   9191 
   9192 # Syntax errors caught by the parser
   9193 # ----------------------------------
   9194 # Exercise the discarding of stack top and input until `error'
   9195 # can be reduced.
   9196 #
   9197 #     '(', 'x', 'x', 'x', 'x', 'x', ')',
   9198 #
   9199 # Load the stack and provoke an error that cannot be caught by the
   9200 # grammar, to check that the stack is cleared.  And make sure the
   9201 # lookahead is freed.
   9202 #
   9203 #     '(', 'x', ')',
   9204 #     '(', 'x', ')',
   9205 #     'y'
   9206 $at_traceoff
   9207 echo "actions.at:536: \$PREPARSER ./input '(xxxxx)(x)(x)y'"
   9208 echo actions.at:536 >$at_check_line_file
   9209 ( $at_traceon; $PREPARSER ./input '(xxxxx)(x)(x)y' ) >$at_stdout 2>$at_stder1
   9210 at_status=$?
   9211 grep '^ *+' $at_stder1 >&2
   9212 grep -v '^ *+' $at_stder1 >$at_stderr
   9213 at_failed=false
   9214 $at_diff $at_devnull $at_stderr || at_failed=:
   9215 echo >>$at_stdout; echo "sending: '(' (0@0-9)
   9216 sending: 'x' (1@10-19)
   9217 thing (1@10-19): 'x' (1@10-19)
   9218 sending: 'x' (2@20-29)
   9219 thing (2@20-29): 'x' (2@20-29)
   9220 sending: 'x' (3@30-39)
   9221 30-39: syntax error, unexpected 'x', expecting ')'
   9222 Freeing nterm thing (2@20-29)
   9223 Freeing nterm thing (1@10-19)
   9224 Freeing token 'x' (3@30-39)
   9225 sending: 'x' (4@40-49)
   9226 Freeing token 'x' (4@40-49)
   9227 sending: 'x' (5@50-59)
   9228 Freeing token 'x' (5@50-59)
   9229 sending: ')' (6@60-69)
   9230 line (-1@0-69): '(' (0@0-9) error (@10-59) ')' (6@60-69)
   9231 sending: '(' (7@70-79)
   9232 sending: 'x' (8@80-89)
   9233 thing (8@80-89): 'x' (8@80-89)
   9234 sending: ')' (9@90-99)
   9235 line (7@70-99): '(' (7@70-79) thing (8@80-89) ')' (9@90-99)
   9236 sending: '(' (10@100-109)
   9237 sending: 'x' (11@110-119)
   9238 thing (11@110-119): 'x' (11@110-119)
   9239 sending: ')' (12@120-129)
   9240 line (10@100-129): '(' (10@100-109) thing (11@110-119) ')' (12@120-129)
   9241 sending: 'y' (13@130-139)
   9242 input (0@129-129): /* Nothing */
   9243 input (2@100-129): line (10@100-129) input (0@129-129)
   9244 input (2@70-129): line (7@70-99) input (2@100-129)
   9245 input (2@0-129): line (-1@0-69) input (2@70-129)
   9246 130-139: syntax error, unexpected 'y', expecting \$end
   9247 Freeing nterm input (2@0-129)
   9248 Freeing token 'y' (13@130-139)
   9249 Parsing FAILED.
   9250 " | $at_diff - $at_stdout || at_failed=:
   9251 case $at_status in
   9252    77) echo 77 > $at_status_file
   9253             exit 77;;
   9254    1) ;;
   9255    *) echo "actions.at:536: exit code was $at_status, expected 1"
   9256       at_failed=:;;
   9257 esac
   9258 if $at_failed; then
   9259 
   9260   echo 1 > $at_status_file
   9261   exit 1
   9262 fi
   9263 
   9264 $at_traceon
   9265 
   9266 
   9267 # Check destruction upon stack overflow
   9268 # -------------------------------------
   9269 # Upon stack overflow, all symbols on the stack should be destroyed.
   9270 # Only check for yacc.c.
   9271 
   9272 
   9273 
   9274 
   9275       $at_traceoff
   9276       $at_times_p && times >$at_times_file
   9277     ) 5>&1 2>&1 | eval $at_tee_pipe
   9278     at_status=`cat $at_status_file`
   9279     ;;
   9280 
   9281   57 ) # 57. actions.at:537: Printers and Destructors with union: %glr-parser
   9282     at_setup_line='actions.at:537'
   9283     at_desc='Printers and Destructors with union: %glr-parser'
   9284     $at_quiet $ECHO_N " 57: Printers and Destructors with union: %glr-parser$ECHO_C"
   9285     at_xfail=no
   9286     (
   9287       echo "57. actions.at:537: testing ..."
   9288       $at_traceon
   9289 
   9290 
   9291 
   9292 # Make sure complex $n work.
   9293 
   9294 # Be sure to pass all the %directives to this macro to have correct
   9295 # helping macros.  So don't put any directly in the Bison file.
   9296 
   9297 
   9298 
   9299 
   9300 # Using yacc.c?
   9301 
   9302 
   9303 
   9304 
   9305 
   9306 
   9307 
   9308 # yyerror receives the location if %location & %pure & (%glr or %parse-param).
   9309 
   9310 # yyerror always sees the locations (when activated), except if
   9311 # yacc & pure & !param.
   9312 
   9313 
   9314 # The interface is pure: either because %pure-parser, or because we
   9315 # are using the C++ parsers.
   9316 
   9317 
   9318 
   9319 
   9320 
   9321 
   9322 
   9323 
   9324 
   9325 
   9326 
   9327 cat >input.y <<'_ATEOF'
   9328 %{
   9329 #ifdef HAVE_CONFIG_H
   9330 # include <config.h>
   9331   /* We don't need perfect functions for these tests. */
   9332 # undef malloc
   9333 # undef memcmp
   9334 # undef realloc
   9335 #endif
   9336 %}
   9337 
   9338 %{
   9339 #include <stdio.h>
   9340 #include <stdlib.h>
   9341 #include <assert.h>
   9342 
   9343 #define YYINITDEPTH 10
   9344 #define YYMAXDEPTH 10
   9345 #define RANGE(Location) (Location).first_line, (Location).last_line
   9346 %}
   9347 
   9348 %error-verbose
   9349 %debug
   9350 %verbose
   9351 %locations
   9352 %glr-parser
   9353 %union
   9354 {
   9355   int ival;
   9356 }
   9357 
   9358 
   9359 %{
   9360 
   9361 static int yylex (void);
   9362 static void yyerror (const char *msg);
   9363 %}
   9364 
   9365 %type <ival> '(' 'x' 'y' ')' ';' thing line input
   9366 
   9367 %printer
   9368   {
   9369     fprintf (yyoutput, "%d", $$);
   9370   }
   9371   input line thing 'x' 'y'
   9372 
   9373 %destructor
   9374   { printf ("Freeing nterm input (%d@%d-%d)\n", $$, RANGE (@$)); }
   9375   input
   9376 
   9377 %destructor
   9378   { printf ("Freeing nterm line (%d@%d-%d)\n", $$, RANGE (@$)); }
   9379   line
   9380 
   9381 %destructor
   9382   { printf ("Freeing nterm thing (%d@%d-%d)\n", $$, RANGE (@$)); }
   9383   thing
   9384 
   9385 %destructor
   9386   { printf ("Freeing token 'x' (%d@%d-%d)\n", $$, RANGE (@$)); }
   9387   'x'
   9388 
   9389 %destructor
   9390   { printf ("Freeing token 'y' (%d@%d-%d)\n", $$, RANGE (@$)); }
   9391   'y'
   9392 
   9393 %%
   9394 /*
   9395    This grammar is made to exercise error recovery.
   9396    "Lines" starting with `(' support error recovery, with
   9397    ')' as synchronizing token.  Lines starting with 'x' can never
   9398    be recovered from if in error.
   9399 */
   9400 
   9401 input:
   9402   /* Nothing. */
   9403     {
   9404       $$ = 0;
   9405       printf ("input (%d@%d-%d): /* Nothing */\n", $$, RANGE (@$));
   9406     }
   9407 | line <