#! /bin/sh
# Generated from local.at by GNU Autoconf 2.65.
#
# Copyright (C) 2009 Free Software Foundation, Inc.
#
# This test suite is free software; the Free Software Foundation gives
# unlimited permission to copy, distribute and modify it.
## -------------------- ##
## M4sh Initialization. ##
## -------------------- ##

# Be more Bourne compatible
DUALCASE=1; export DUALCASE # for MKS sh
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
  emulate sh
  NULLCMD=:
  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
  # is contrary to our usage.  Disable this feature.
  alias -g '${1+"$@"}'='"$@"'
  setopt NO_GLOB_SUBST
else
  case `(set -o) 2>/dev/null` in #(
  *posix*) :
    set -o posix ;; #(
  *) :
     ;;
esac
fi


as_nl='
'
export as_nl
# Printing a long string crashes Solaris 7 /usr/bin/printf.
as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
# Prefer a ksh shell builtin over an external printf program on Solaris,
# but without wasting forks for bash or zsh.
if test -z "$BASH_VERSION$ZSH_VERSION" \
    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
  as_echo='print -r --'
  as_echo_n='print -rn --'
elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
  as_echo='printf %s\n'
  as_echo_n='printf %s'
else
  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
    as_echo_n='/usr/ucb/echo -n'
  else
    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
    as_echo_n_body='eval
      arg=$1;
      case $arg in #(
      *"$as_nl"*)
	expr "X$arg" : "X\\(.*\\)$as_nl";
	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
      esac;
      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
    '
    export as_echo_n_body
    as_echo_n='sh -c $as_echo_n_body as_echo'
  fi
  export as_echo_body
  as_echo='sh -c $as_echo_body as_echo'
fi

# The user is always right.
if test "${PATH_SEPARATOR+set}" != set; then
  PATH_SEPARATOR=:
  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
      PATH_SEPARATOR=';'
  }
fi


# IFS
# We need space, tab and new line, in precisely that order.  Quoting is
# there to prevent editors from complaining about space-tab.
# (If _AS_PATH_WALK were called with IFS unset, it would disable word
# splitting by setting IFS to empty value.)
IFS=" ""	$as_nl"

# Find who we are.  Look in the path if we contain no directory separator.
case $0 in #((
  *[\\/]* ) as_myself=$0 ;;
  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
  done
IFS=$as_save_IFS

     ;;
esac
# We did not find ourselves, most probably we were run as `sh COMMAND'
# in which case we are not to be found in the path.
if test "x$as_myself" = x; then
  as_myself=$0
fi
if test ! -f "$as_myself"; then
  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
  exit 1
fi

# Unset variables that we do not need and which cause bugs (e.g. in
# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
# suppresses any "Segmentation fault" message there.  '((' could
# trigger a bug in pdksh 5.2.14.
for as_var in BASH_ENV ENV MAIL MAILPATH
do eval test x\${$as_var+set} = xset \
  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
done
PS1='$ '
PS2='> '
PS4='+ '

# NLS nuisances.
LC_ALL=C
export LC_ALL
LANGUAGE=C
export LANGUAGE

# CDPATH.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH

if test "x$CONFIG_SHELL" = x; then
  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
  emulate sh
  NULLCMD=:
  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
  # is contrary to our usage.  Disable this feature.
  alias -g '\${1+\"\$@\"}'='\"\$@\"'
  setopt NO_GLOB_SUBST
else
  case \`(set -o) 2>/dev/null\` in #(
  *posix*) :
    set -o posix ;; #(
  *) :
     ;;
esac
fi
"
  as_required="as_fn_return () { (exit \$1); }
as_fn_success () { as_fn_return 0; }
as_fn_failure () { as_fn_return 1; }
as_fn_ret_success () { return 0; }
as_fn_ret_failure () { return 1; }

exitcode=0
as_fn_success || { exitcode=1; echo as_fn_success failed.; }
as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :

else
  exitcode=1; echo positional parameters were not saved.
fi
test x\$exitcode = x0 || exit 1"
  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
test \$(( 1 + 1 )) = 2 || exit 1"
  if (eval "$as_required") 2>/dev/null; then :
  as_have_required=yes
else
  as_have_required=no
fi
  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :

else
  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
as_found=false
for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
  as_found=:
  case $as_dir in #(
	 /*)
	   for as_base in sh bash ksh sh5; do
	     # Try only shells that exist, to save several forks.
	     as_shell=$as_dir/$as_base
	     if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
		    { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
  CONFIG_SHELL=$as_shell as_have_required=yes
		   if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
  break 2
fi
fi
	   done;;
       esac
  as_found=false
done
$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
	      { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
  CONFIG_SHELL=$SHELL as_have_required=yes
fi; }
IFS=$as_save_IFS


      if test "x$CONFIG_SHELL" != x; then :
  # We cannot yet assume a decent shell, so we have to provide a
	# neutralization value for shells without unset; and this also
	# works around shells that cannot unset nonexistent variables.
	BASH_ENV=/dev/null
	ENV=/dev/null
	(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
	export CONFIG_SHELL
	exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
fi

    if test x$as_have_required = xno; then :
  $as_echo "$0: This script requires a shell more modern than all"
  $as_echo "$0: the shells that I found on your system."
  if test x${ZSH_VERSION+set} = xset ; then
    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
  else
    $as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
$0: including any error possibly output before this
$0: message. Then install a modern shell, or manually run
$0: the script under such a shell if you do have one."
  fi
  exit 1
fi
fi
fi
SHELL=${CONFIG_SHELL-/bin/sh}
export SHELL
# Unset more variables known to interfere with behavior of common tools.
CLICOLOR_FORCE= GREP_OPTIONS=
unset CLICOLOR_FORCE GREP_OPTIONS

## --------------------- ##
## M4sh Shell Functions. ##
## --------------------- ##
# as_fn_unset VAR
# ---------------
# Portably unset VAR.
as_fn_unset ()
{
  { eval $1=; unset $1;}
}
as_unset=as_fn_unset

# as_fn_set_status STATUS
# -----------------------
# Set $? to STATUS, without forking.
as_fn_set_status ()
{
  return $1
} # as_fn_set_status

# as_fn_exit STATUS
# -----------------
# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
as_fn_exit ()
{
  set +e
  as_fn_set_status $1
  exit $1
} # as_fn_exit

# as_fn_mkdir_p
# -------------
# Create "$as_dir" as a directory, including parents if necessary.
as_fn_mkdir_p ()
{

  case $as_dir in #(
  -*) as_dir=./$as_dir;;
  esac
  test -d "$as_dir" || eval $as_mkdir_p || {
    as_dirs=
    while :; do
      case $as_dir in #(
      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
      *) as_qdir=$as_dir;;
      esac
      as_dirs="'$as_qdir' $as_dirs"
      as_dir=`$as_dirname -- "$as_dir" ||
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
	 X"$as_dir" : 'X\(//\)[^/]' \| \
	 X"$as_dir" : 'X\(//\)$' \| \
	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$as_dir" |
    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)[^/].*/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\).*/{
	    s//\1/
	    q
	  }
	  s/.*/./; q'`
      test -d "$as_dir" && break
    done
    test -z "$as_dirs" || eval "mkdir $as_dirs"
  } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir"


} # as_fn_mkdir_p
# as_fn_append VAR VALUE
# ----------------------
# Append the text in VALUE to the end of the definition contained in VAR. Take
# advantage of any shell optimizations that allow amortized linear growth over
# repeated appends, instead of the typical quadratic growth present in naive
# implementations.
if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
  eval 'as_fn_append ()
  {
    eval $1+=\$2
  }'
else
  as_fn_append ()
  {
    eval $1=\$$1\$2
  }
fi # as_fn_append

# as_fn_arith ARG...
# ------------------
# Perform arithmetic evaluation on the ARGs, and store the result in the
# global $as_val. Take advantage of shells that can avoid forks. The arguments
# must be portable across $(()) and expr.
if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
  eval 'as_fn_arith ()
  {
    as_val=$(( $* ))
  }'
else
  as_fn_arith ()
  {
    as_val=`expr "$@" || test $? -eq 1`
  }
fi # as_fn_arith


# as_fn_error ERROR [LINENO LOG_FD]
# ---------------------------------
# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
# script with status $?, using 1 if that was 0.
as_fn_error ()
{
  as_status=$?; test $as_status -eq 0 && as_status=1
  if test "$3"; then
    as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
    $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3
  fi
  $as_echo "$as_me: error: $1" >&2
  as_fn_exit $as_status
} # as_fn_error

if expr a : '\(a\)' >/dev/null 2>&1 &&
   test "X`expr 00001 : '.*\(...\)'`" = X001; then
  as_expr=expr
else
  as_expr=false
fi

if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
  as_basename=basename
else
  as_basename=false
fi

as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
	 X"$0" : 'X\(//\)$' \| \
	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X/"$0" |
    sed '/^.*\/\([^/][^/]*\)\/*$/{
	    s//\1/
	    q
	  }
	  /^X\/\(\/\/\)$/{
	    s//\1/
	    q
	  }
	  /^X\/\(\/\).*/{
	    s//\1/
	    q
	  }
	  s/.*/./; q'`

if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
  as_dirname=dirname
else
  as_dirname=false
fi

# Avoid depending upon Character Ranges.
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits


  as_lineno_1=$LINENO as_lineno_1a=$LINENO
  as_lineno_2=$LINENO as_lineno_2a=$LINENO
  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
  sed -n '
    p
    /[$]LINENO/=
  ' <$as_myself |
    sed '
      s/[$]LINENO.*/&-/
      t lineno
      b
      :lineno
      N
      :loop
      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
      t loop
      s/-\n.*//
    ' >$as_me.lineno &&
  chmod +x "$as_me.lineno" ||
    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }

  # Don't try to exec as it changes $[0], causing all sort of problems
  # (the dirname of $[0] is not the place where we might find the
  # original and so on.  Autoconf is especially sensitive to this).
  . "./$as_me.lineno"
  # Exit status is that of the last command.
  exit
}

ECHO_C= ECHO_N= ECHO_T=
case `echo -n x` in #(((((
-n*)
  case `echo 'xy\c'` in
  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
  xy)  ECHO_C='\c';;
  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
       ECHO_T='	';;
  esac;;
*)
  ECHO_N='-n';;
esac

rm -f conf$$ conf$$.exe conf$$.file
if test -d conf$$.dir; then
  rm -f conf$$.dir/conf$$.file
else
  rm -f conf$$.dir
  mkdir conf$$.dir 2>/dev/null
fi
if (echo >conf$$.file) 2>/dev/null; then
  if ln -s conf$$.file conf$$ 2>/dev/null; then
    as_ln_s='ln -s'
    # ... but there are two gotchas:
    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
    # In both cases, we have to default to `cp -p'.
    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
      as_ln_s='cp -p'
  elif ln conf$$.file conf$$ 2>/dev/null; then
    as_ln_s=ln
  else
    as_ln_s='cp -p'
  fi
else
  as_ln_s='cp -p'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null

if mkdir -p . 2>/dev/null; then
  as_mkdir_p='mkdir -p "$as_dir"'
else
  test -d ./-p && rmdir ./-p
  as_mkdir_p=false
fi

if test -x / >/dev/null 2>&1; then
  as_test_x='test -x'
else
  if ls -dL / >/dev/null 2>&1; then
    as_ls_L_option=L
  else
    as_ls_L_option=
  fi
  as_test_x='
    eval sh -c '\''
      if test -d "$1"; then
	test -d "$1/.";
      else
	case $1 in #(
	-*)set "./$1";;
	esac;
	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
	???[sx]*):;;*)false;;esac;fi
    '\'' sh
  '
fi
as_executable_p=$as_test_x

# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"

# Sed expression to map a string onto a valid variable name.
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"





SHELL=${CONFIG_SHELL-/bin/sh}

# How were we run?
at_cli_args="$@"


# Not all shells have the 'times' builtin; the subshell is needed to make
# sure we discard the 'times: not found' message from the shell.
at_times_p=false
(times) >/dev/null 2>&1 && at_times_p=:

# CLI Arguments to pass to the debugging scripts.
at_debug_args=
# -e sets to true
at_errexit_p=false
# Shall we be verbose?  ':' means no, empty means yes.
at_verbose=:
at_quiet=
# Running several jobs in parallel, 0 means as many as test groups.
at_jobs=1
at_traceon=:
at_trace_echo=:
at_check_filter_trace=:

# Shall we keep the debug scripts?  Must be `:' when the suite is
# run by a debug script, so that the script doesn't remove itself.
at_debug_p=false
# Display help message?
at_help_p=false
# Display the version message?
at_version_p=false
# List test groups?
at_list_p=false
# --clean
at_clean=false
# Test groups to run
at_groups=
# Whether a write failure occurred
at_write_fail=0

# The directory we run the suite in.  Default to . if no -C option.
at_dir=`pwd`
# An absolute reference to this testsuite script.
case $as_myself in
  [\\/]* | ?:[\\/]* ) at_myself=$as_myself ;;
  * ) at_myself=$at_dir/$as_myself ;;
esac
# Whether -C is in effect.
at_change_dir=false

# List of the tested programs.
at_tested='bison'
# List of the all the test groups.
at_groups_all=' 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243'
# As many question marks as there are digits in the last test group number.
# Used to normalize the test group numbers so that `ls' lists them in
# numerical order.
at_format='???'
# Description of all the test groups.
at_help_all="1;input.at:26;Invalid \$n and @n;;
2;input.at:46;Type Clashes;;
3;input.at:160;Unused values;;
4;input.at:170;Unused values before symbol declarations;;
5;input.at:180;Default %printer and %destructor redeclared;;
6;input.at:240;Per-type %printer and %destructor redeclared;;
7;input.at:283;Unused values with default %destructor;;
8;input.at:325;Unused values with per-type %destructor;;
9;input.at:350;Incompatible Aliases;;
10;input.at:391;Torturing the Scanner;;
11;input.at:554;Typed symbol aliases;;
12;input.at:590;Require 1.0;;
13;input.at:591;Require 2.4.1b;;
14;input.at:593;Require 100.0;;
15;input.at:600;String aliases for character tokens;;
16;input.at:621;Unclosed constructs;;
17;input.at:666;%start after first rule;;
18;input.at:687;%prec takes a token;;
19;input.at:708;%prec's token must be defined;;
20;input.at:728;Reject unused %code qualifiers;;
21;input.at:817;%define errors;;
22;input.at:847;%define Boolean variables;;
23;input.at:867;%define enum variables;;
24;input.at:885;Unused %define api.pure;;
25;input.at:918;C++ namespace reference errors;;
26;input.at:967;Bad escapes in literals;;
27;output.at:42;Output files:  -dv ;;
28;output.at:44;Output files:  -dv >&-;;
29;output.at:47;Output files:  -dv -o foo.c ;;
30;output.at:49;Output files:  -dv -o foo.tab.c ;;
31;output.at:51;Output files:  -dv -y ;;
32;output.at:53;Output files:  -dv -b bar ;;
33;output.at:55;Output files:  -dv -g -o foo.c ;;
34;output.at:59;Output files: %defines %verbose  ;;
35;output.at:61;Output files: %defines %verbose %yacc  ;;
36;output.at:64;Output files: %defines %verbose %yacc  ;;
37;output.at:68;Output files: %file-prefix \"bar\" %defines %verbose  ;;
38;output.at:70;Output files: %output=\"bar.c\" %defines %verbose %yacc  ;;
39;output.at:72;Output files: %file-prefix=\"baz\" %output \"bar.c\" %defines %verbose %yacc  ;;
40;output.at:79;Output files: %defines %verbose  ;;
41;output.at:82;Output files: %defines %verbose  -o foo.c ;;
42;output.at:85;Output files:  --defines=foo.hpp -o foo.c++ ;;
43;output.at:89;Output files: %defines \"foo.hpp\" -o foo.c++ ;;
44;output.at:93;Output files:  -o foo.c++ --graph=foo.gph ;;
45;output.at:108;Output files: %skeleton \"lalr1.cc\" %defines %verbose  ;;
46;output.at:111;Output files: %skeleton \"lalr1.cc\" %defines %verbose  ;;
47;output.at:115;Output files: %skeleton \"lalr1.cc\" %defines %verbose -o subdir/foo.cc ;;
48;output.at:120;Output files: %skeleton \"lalr1.cc\" %defines %verbose %file-prefix \"output_dir/foo\"  ;;
49;output.at:150;Conflicting output files:  --graph=\"foo.tab.c\";;
50;output.at:155;Conflicting output files: %defines \"foo.output\" -v;;
51;output.at:160;Conflicting output files: %skeleton \"lalr1.cc\" %defines --graph=\"location.hh\";;
52;output.at:165;Conflicting output files:  -o foo.y;;
53;output.at:209;Output file name: \`~!@#\$%^&*()-=_+{}[]|\\:;<>, .';c++;
54;output.at:216;Output file name: (;c++;
55;output.at:217;Output file name: );c++;
56;output.at:218;Output file name: #;c++;
57;output.at:219;Output file name: @@;c++;
58;output.at:220;Output file name: @{;c++;
59;output.at:221;Output file name: @};c++;
60;output.at:222;Output file name: [;c++;
61;output.at:223;Output file name: ];c++;
62;skeletons.at:23;Relative skeleton file names;;
63;skeletons.at:83;Installed skeleton file names;;
64;skeletons.at:148;%define Boolean variables: invalid skeleton defaults;;
65;skeletons.at:172;Complaining during macro argument expansion;;
66;skeletons.at:254;Fatal errors make M4 exit immediately;;
67;skeletons.at:308;Fatal errors but M4 continues producing output;;
68;sets.at:65;Nullable;;
69;sets.at:150;Broken Closure;;
70;sets.at:192;Firsts;;
71;sets.at:268;Accept;;
72;reduce.at:24;Useless Terminals;;
73;reduce.at:68;Useless Nonterminals;;
74;reduce.at:123;Useless Rules;report;
75;reduce.at:211;Reduced Automaton;report;
76;reduce.at:301;Underivable Rules;report;
77;reduce.at:343;Empty Language;;
78;synclines.at:84;Prologue synch line;;
79;synclines.at:101;%union synch line;;
80;synclines.at:121;Postprologue synch line;;
81;synclines.at:144;Action synch line;;
82;synclines.at:163;Epilogue synch line;;
83;headers.at:26;%union and --defines;;
84;headers.at:76;Invalid CPP guards: input/input;;
85;headers.at:77;Invalid CPP guards: 9foo;;
86;headers.at:86;export YYLTYPE;;
87;actions.at:23;Mid-rule actions;;
88;actions.at:92;Exotic Dollars;;
89;actions.at:573;Printers and Destructors : ;;
90;actions.at:574;Printers and Destructors with union: ;;
91;actions.at:576;Printers and Destructors : %defines %skeleton \"lalr1.cc\";c++;
92;actions.at:577;Printers and Destructors with union: %defines %skeleton \"lalr1.cc\";c++;
93;actions.at:579;Printers and Destructors : %glr-parser;;
94;actions.at:580;Printers and Destructors with union: %glr-parser;;
95;actions.at:591;Default tagless %printer and %destructor;;
96;actions.at:709;Default tagged and per-type %printer and %destructor;;
97;actions.at:846;Default %printer and %destructor for user-defined end token;;
98;actions.at:960;Default %printer and %destructor are not for error or \$undefined;;
99;actions.at:1070;Default %printer and %destructor are not for \$accept;;
100;actions.at:1147;Default %printer and %destructor for mid-rule values;;
101;actions.at:1303;@\$ in %initial-action implies %locations;;
102;actions.at:1304;@\$ in %destructor implies %locations;;
103;actions.at:1305;@\$ in %printer implies %locations;;
104;conflicts.at:31;S/R in initial;;
105;conflicts.at:51;%nonassoc and eof;;
106;conflicts.at:126;Unresolved SR Conflicts;report;
107;conflicts.at:233;Resolved SR Conflicts;report;
108;conflicts.at:355;Defaulted Conflicted Reduction;report;
109;conflicts.at:474;%expect not enough;;
110;conflicts.at:494;%expect right;;
111;conflicts.at:511;%expect too much;;
112;conflicts.at:531;%expect with reduce conflicts;;
113;conflicts.at:551;%no-default-prec without %prec;;
114;conflicts.at:577;%no-default-prec with %prec;;
115;conflicts.at:601;%default-prec;;
116;conflicts.at:625;Unreachable States After Conflict Resolution;;
117;conflicts.at:836;Solved conflicts report for multiple reductions in a state;;
118;conflicts.at:916;%nonassoc error actions for multiple reductions in a state;;
119;calc.at:568;Calculator ;;
120;calc.at:570;Calculator %defines;;
121;calc.at:571;Calculator %locations;;
122;calc.at:572;Calculator %name-prefix=\"calc\";;
123;calc.at:573;Calculator %verbose;;
124;calc.at:574;Calculator %yacc;;
125;calc.at:575;Calculator %error-verbose;;
126;calc.at:577;Calculator %define api.pure %locations;;
127;calc.at:578;Calculator %define api.push_pull \"both\" %define api.pure %locations;;
128;calc.at:579;Calculator %error-verbose %locations;;
129;calc.at:581;Calculator %error-verbose %locations %defines %name-prefix \"calc\" %verbose %yacc;;
130;calc.at:583;Calculator %debug;;
131;calc.at:584;Calculator %error-verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc;;
132;calc.at:586;Calculator %define api.pure %error-verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc;;
133;calc.at:587;Calculator %define api.push_pull \"both\" %define api.pure %error-verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc;;
134;calc.at:589;Calculator %define api.pure %error-verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count};;
135;calc.at:606;Calculator %glr-parser ;;
136;calc.at:608;Calculator %glr-parser %defines;;
137;calc.at:609;Calculator %glr-parser %locations;;
138;calc.at:610;Calculator %glr-parser %name-prefix \"calc\";;
139;calc.at:611;Calculator %glr-parser %verbose;;
140;calc.at:612;Calculator %glr-parser %yacc;;
141;calc.at:613;Calculator %glr-parser %error-verbose;;
142;calc.at:615;Calculator %glr-parser %define api.pure %locations;;
143;calc.at:616;Calculator %glr-parser %error-verbose %locations;;
144;calc.at:618;Calculator %glr-parser %error-verbose %locations %defines %name-prefix \"calc\" %verbose %yacc;;
145;calc.at:620;Calculator %glr-parser %debug;;
146;calc.at:621;Calculator %glr-parser %error-verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc;;
147;calc.at:623;Calculator %glr-parser %define api.pure %error-verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc;;
148;calc.at:625;Calculator %glr-parser %define api.pure %error-verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count};;
149;calc.at:635;Calculator %skeleton \"lalr1.cc\" %defines %locations;c++;
150;calc.at:644;Calculator %language \"C++\" %defines %locations ;c++;
151;calc.at:645;Calculator %language \"C++\" %defines %locations %error-verbose %name-prefix \"calc\" %verbose %yacc;c++;
152;calc.at:647;Calculator %language \"C++\" %defines %locations %error-verbose %debug %name-prefix \"calc\" %verbose %yacc;c++;
153;calc.at:649;Calculator %language \"C++\" %defines %locations %pure-parser %error-verbose %debug %name-prefix \"calc\" %verbose %yacc;c++;
154;calc.at:651;Calculator %language \"C++\" %defines %locations %pure-parser %error-verbose %debug %name-prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count};c++;
155;calc.at:662;Calculator %skeleton \"glr.cc\" %defines %locations;c++;
156;calc.at:671;Calculator %language \"C++\" %glr-parser %defines %locations ;c++;
157;calc.at:672;Calculator %language \"C++\" %glr-parser %defines %locations %error-verbose %name-prefix \"calc\" %verbose %yacc;c++;
158;calc.at:674;Calculator %language \"C++\" %glr-parser %defines %locations %debug;c++;
159;calc.at:675;Calculator %language \"C++\" %glr-parser %defines %locations %error-verbose %debug %name-prefix \"calc\" %verbose %yacc;c++;
160;calc.at:677;Calculator %language \"C++\" %glr-parser %defines %locations %pure-parser %error-verbose %debug %name-prefix \"calc\" %verbose %yacc;c++;
161;calc.at:679;Calculator %language \"C++\" %glr-parser %defines %locations %pure-parser %error-verbose %debug %name-prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count};c++;
162;torture.at:139;Big triangle;;
163;torture.at:232;Big horizontal;;
164;torture.at:372;Many lookahead tokens;;
165;torture.at:473;Exploding the Stack Size with Alloca;;
166;torture.at:519;Exploding the Stack Size with Malloc;;
167;existing.at:24;GNU AWK Grammar;;
168;existing.at:362;GNU Cim Grammar;;
169;existing.at:978;GNU pic Grammar;;
170;regression.at:25;Trivial grammars;;
171;regression.at:53;YYSTYPE typedef;;
172;regression.at:81;Early token definitions with --yacc;;
173;regression.at:119;Early token definitions without --yacc;;
174;regression.at:162;Braces parsing;;
175;regression.at:184;Duplicate string;;
176;regression.at:210;Rule Line Numbers;report;
177;regression.at:354;Mixing %token styles;;
178;regression.at:377;Invalid inputs;;
179;regression.at:404;Invalid inputs with {};;
180;regression.at:429;Token definitions;;
181;regression.at:499;Characters Escapes;;
182;regression.at:530;Web2c Report;report;
183;regression.at:707;Web2c Actions;report;
184;regression.at:953;Dancer ;;
185;regression.at:954;Dancer %glr-parser;;
186;regression.at:955;Dancer %skeleton \"lalr1.cc\";c++;
187;regression.at:1053;Expecting two tokens ;;
188;regression.at:1054;Expecting two tokens %glr-parser;;
189;regression.at:1055;Expecting two tokens %skeleton \"lalr1.cc\";c++;
190;regression.at:1063;Braced code in declaration in rules section;;
191;regression.at:1139;String alias declared after use;;
192;regression.at:1162;Extra lookahead sets in report;;
193;regression.at:1203;Token number in precedence declaration;;
194;regression.at:1264;Fix user actions without a trailing semicolon;;
195;c++.at:101;Doxygen Public Documentation;;
196;c++.at:102;Doxygen Private Documentation;;
197;c++.at:160;Relative namespace references;c++;
198;c++.at:166;Absolute namespace references;c++;
199;c++.at:175;Syntactically invalid namespace references;;
200;java.at:385;Calculator ;;
201;java.at:385;Calculator %error-verbose ;;
202;java.at:385;Calculator %locations ;;
203;java.at:385;Calculator %error-verbose %locations ;;
204;java.at:394;Calculator %lex-param { InputStream is } ;;
205;java.at:394;Calculator %error-verbose %lex-param { InputStream is } ;;
206;java.at:394;Calculator %locations %lex-param { InputStream is } ;;
207;java.at:394;Calculator %error-verbose %locations %lex-param { InputStream is } ;;
208;java.at:480;Java parser class and package names;;
209;java.at:501;Java parser class modifiers;;
210;java.at:559;Java parser class extends and implements;;
211;java.at:579;Java %parse-param and %lex-param;;
212;java.at:653;Java throws specifications;;
213;java.at:742;Java stype, position_class and location_class;;
214;cxx-type.at:412;GLR: Resolve ambiguity, impure, no locations;;
215;cxx-type.at:419;GLR: Resolve ambiguity, impure, locations;;
216;cxx-type.at:425;GLR: Resolve ambiguity, pure, no locations;;
217;cxx-type.at:432;GLR: Resolve ambiguity, pure, locations;;
218;cxx-type.at:439;GLR: Merge conflicting parses, impure, no locations;;
219;cxx-type.at:446;GLR: Merge conflicting parses, impure, locations;;
220;cxx-type.at:453;GLR: Merge conflicting parses, pure, no locations;;
221;cxx-type.at:459;GLR: Merge conflicting parses, pure, locations;;
222;cxx-type.at:466;GLR: Verbose messages, resolve ambiguity, impure, no locations;;
223;glr-regression.at:24;Badly Collapsed GLR States;;
224;glr-regression.at:119;Improper handling of embedded actions and dollar(-N) in GLR parsers;;
225;glr-regression.at:238;Improper merging of GLR delayed action sets;;
226;glr-regression.at:347;Duplicate representation of merged trees;;
227;glr-regression.at:450;User destructor for unresolved GLR semantic value;;
228;glr-regression.at:523;User destructor after an error during a split parse;;
229;glr-regression.at:590;Duplicated user destructor for lookahead;;
230;glr-regression.at:682;Incorrectly initialized location for empty right-hand side in GLR;;
231;glr-regression.at:780;No users destructors if stack 0 deleted;;
232;glr-regression.at:860;Corrupted semantic options if user action cuts parse;;
233;glr-regression.at:925;Undesirable destructors if user action cuts parse;;
234;glr-regression.at:994;Leaked semantic values if user action cuts parse;;
235;glr-regression.at:1127;Incorrect lookahead during deterministic GLR;;
236;glr-regression.at:1263;Incorrect lookahead during nondeterministic GLR;;
237;glr-regression.at:1483;Leaked semantic values when reporting ambiguity;;
238;glr-regression.at:1576;Leaked lookahead after nondeterministic parse syntax error;;
239;glr-regression.at:1645;Uninitialized location when reporting ambiguity;;
240;glr-regression.at:1732;Missed %merge type warnings when LHS type is declared later;;
241;push.at:23;Memory Leak for Early Deletion;;
242;push.at:84;Multiple impure instances;;
243;push.at:155;Unsupported Skeletons;;
"

# at_fn_validate_ranges NAME...
# -----------------------------
# Validate and normalize the test group number contained in each variable
# NAME. Leading zeroes are treated as decimal.
at_fn_validate_ranges ()
{
  for at_grp
  do
    eval at_value=\$$at_grp
    if test $at_value -lt 1 || test $at_value -gt 243; then
      $as_echo "invalid test group: $at_value" >&2
      exit 1
    fi
    case $at_value in
      0*) # We want to treat leading 0 as decimal, like expr and test, but
	  # AS_VAR_ARITH treats it as octal if it uses $(( )).
	  # With XSI shells, ${at_value#${at_value%%[1-9]*}} avoids the
	  # expr fork, but it is not worth the effort to determine if the
	  # shell supports XSI when the user can just avoid leading 0.
	  eval $at_grp='`expr $at_value + 0`' ;;
    esac
  done
}

at_prev=
for at_option
do
  # If the previous option needs an argument, assign it.
  if test -n "$at_prev"; then
    at_option=$at_prev=$at_option
    at_prev=
  fi

  case $at_option in
  *=*) at_optarg=`expr "x$at_option" : 'x[^=]*=\(.*\)'` ;;
  *)   at_optarg= ;;
  esac

  # Accept the important Cygnus configure options, so we can diagnose typos.

  case $at_option in
    --help | -h )
	at_help_p=:
	;;

    --list | -l )
	at_list_p=:
	;;

    --version | -V )
	at_version_p=:
	;;

    --clean | -c )
	at_clean=:
	;;

    --debug | -d )
	at_debug_p=:
	;;

    --errexit | -e )
	at_debug_p=:
	at_errexit_p=:
	;;

    --verbose | -v )
	at_verbose=; at_quiet=:
	;;

    --trace | -x )
	at_traceon='set -x'
	at_trace_echo=echo
	at_check_filter_trace=at_fn_filter_trace
	;;

    [0-9] | [0-9][0-9] | [0-9][0-9][0-9] | [0-9][0-9][0-9][0-9])
	at_fn_validate_ranges at_option
	as_fn_append at_groups "$at_option "
	;;

    # Ranges
    [0-9]- | [0-9][0-9]- | [0-9][0-9][0-9]- | [0-9][0-9][0-9][0-9]-)
	at_range_start=`echo $at_option |tr -d X-`
	at_fn_validate_ranges at_range_start
	at_range=`$as_echo " $at_groups_all " | \
	  sed -e 's/^.* \('$at_range_start' \)/\1/'`
	as_fn_append at_groups "$at_range "
	;;

    -[0-9] | -[0-9][0-9] | -[0-9][0-9][0-9] | -[0-9][0-9][0-9][0-9])
	at_range_end=`echo $at_option |tr -d X-`
	at_fn_validate_ranges at_range_end
	at_range=`$as_echo " $at_groups_all " | \
	  sed -e 's/\( '$at_range_end'\) .*$/\1/'`
	as_fn_append at_groups "$at_range "
	;;

    [0-9]-[0-9] | [0-9]-[0-9][0-9] | [0-9]-[0-9][0-9][0-9] | \
    [0-9]-[0-9][0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9] | \
    [0-9][0-9]-[0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9][0-9][0-9] | \
    [0-9][0-9][0-9]-[0-9][0-9][0-9] | \
    [0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] | \
    [0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] )
	at_range_start=`expr $at_option : '\(.*\)-'`
	at_range_end=`expr $at_option : '.*-\(.*\)'`
	if test $at_range_start -gt $at_range_end; then
	  at_tmp=$at_range_end
	  at_range_end=$at_range_start
	  at_range_start=$at_tmp
	fi
	at_fn_validate_ranges at_range_start at_range_end
	at_range=`$as_echo " $at_groups_all " | \
	  sed -e 's/^.*\( '$at_range_start' \)/\1/' \
	      -e 's/\( '$at_range_end'\) .*$/\1/'`
	as_fn_append at_groups "$at_range "
	;;

    # Directory selection.
    --directory | -C )
	at_prev=--directory
	;;
    --directory=* )
	at_change_dir=:
	at_dir=$at_optarg
	;;

    # Parallel execution.
    --jobs | -j )
	at_jobs=0
	;;
    --jobs=* | -j[0-9]* )
	if test -n "$at_optarg"; then
	  at_jobs=$at_optarg
	else
	  at_jobs=`expr X$at_option : 'X-j\(.*\)'`
	fi
	case $at_jobs in *[!0-9]*)
	  at_optname=`echo " $at_option" | sed 's/^ //; s/[0-9=].*//'`
	  as_fn_error "non-numeric argument to $at_optname: $at_jobs" ;;
	esac
	;;

    # Keywords.
    --keywords | -k )
	at_prev=--keywords
	;;
    --keywords=* )
	at_groups_selected=$at_help_all
	at_save_IFS=$IFS
	IFS=,
	set X $at_optarg
	shift
	IFS=$at_save_IFS
	for at_keyword
	do
	  at_invert=
	  case $at_keyword in
	  '!'*)
	    at_invert="-v"
	    at_keyword=`expr "X$at_keyword" : 'X!\(.*\)'`
	    ;;
	  esac
	  # It is on purpose that we match the test group titles too.
	  at_groups_selected=`$as_echo "$at_groups_selected" |
	      grep -i $at_invert "^[1-9][^;]*;.*[; ]$at_keyword[ ;]"`
	done
	# Smash the newlines.
	at_groups_selected=`$as_echo "$at_groups_selected" | sed 's/;.*//' |
	  tr "$as_nl" ' '
	`
	as_fn_append at_groups "$at_groups_selected "
	;;

    *=*)
	at_envvar=`expr "x$at_option" : 'x\([^=]*\)='`
	# Reject names that are not valid shell variable names.
	case $at_envvar in
	  '' | [0-9]* | *[!_$as_cr_alnum]* )
	    as_fn_error "invalid variable name: \`$at_envvar'" ;;
	esac
	at_value=`$as_echo "$at_optarg" | sed "s/'/'\\\\\\\\''/g"`
	# Export now, but save eval for later and for debug scripts.
	export $at_envvar
	as_fn_append at_debug_args " $at_envvar='$at_value'"
	;;

     *) $as_echo "$as_me: invalid option: $at_option" >&2
	$as_echo "Try \`$0 --help' for more information." >&2
	exit 1
	;;
  esac
done

# Verify our last option didn't require an argument
if test -n "$at_prev"; then :
  as_fn_error "\`$at_prev' requires an argument."
fi

# Selected test groups.
if test -z "$at_groups"; then
  at_groups=$at_groups_all
else
  # Sort the tests, removing duplicates.
  at_groups=`$as_echo "$at_groups" | tr ' ' "$as_nl" | sort -nu`
fi

# Help message.
if $at_help_p; then
  cat <<_ATEOF || at_write_fail=1
Usage: $0 [OPTION]... [VARIABLE=VALUE]... [TESTS]

Run all the tests, or the selected TESTS, given by numeric ranges, and
save a detailed log file.  Upon failure, create debugging scripts.

Do not change environment variables directly.  Instead, set them via
command line arguments.  Set \`AUTOTEST_PATH' to select the executables
to exercise.  Each relative directory is expanded as build and source
directories relative to the top level of this distribution.
E.g., from within the build directory /tmp/foo-1.0, invoking this:

  $ $0 AUTOTEST_PATH=bin

is equivalent to the following, assuming the source directory is /src/foo-1.0:

  PATH=/tmp/foo-1.0/bin:/src/foo-1.0/bin:\$PATH $0
_ATEOF
cat <<_ATEOF || at_write_fail=1

Operation modes:
  -h, --help     print the help message, then exit
  -V, --version  print version number, then exit
  -c, --clean    remove all the files this test suite might create and exit
  -l, --list     describes all the tests, or the selected TESTS
_ATEOF
cat <<_ATEOF || at_write_fail=1

Execution tuning:
  -C, --directory=DIR
                 change to directory DIR before starting
  -j, --jobs[=N]
                 Allow N jobs at once; infinite jobs with no arg (default 1)
  -k, --keywords=KEYWORDS
                 select the tests matching all the comma-separated KEYWORDS
                 multiple \`-k' accumulate; prefixed \`!' negates a KEYWORD
  -e, --errexit  abort as soon as a test fails; implies --debug
  -v, --verbose  force more detailed output
                 default for debugging scripts
  -d, --debug    inhibit clean up and top-level logging
                 default for debugging scripts
  -x, --trace    enable tests shell tracing
_ATEOF
cat <<_ATEOF || at_write_fail=1

Report bugs to <bug-bison@gnu.org>.
General help using GNU software: <http://www.gnu.org/gethelp/>.
_ATEOF
  exit $at_write_fail
fi

# List of tests.
if $at_list_p; then
  cat <<_ATEOF || at_write_fail=1
GNU Bison 2.4.1b test suite test groups:

 NUM: FILE-NAME:LINE     TEST-GROUP-NAME
      KEYWORDS

_ATEOF
  # Passing at_groups is tricky.  We cannot use it to form a literal string
  # or regexp because of the limitation of AIX awk.  And Solaris' awk
  # doesn't grok more than 99 fields in a record, so we have to use `split'.
  # at_groups needs to be space-separated for this script to work.
  case $at_groups in
    *"$as_nl"* )
      at_groups=`$as_echo "$at_groups" | tr "$as_nl" ' '` ;;
  esac
  $as_echo "$at_groups$as_nl$at_help_all" |
    awk 'BEGIN { FS = ";" }
	 NR == 1 {
	   for (n = split ($ 0, a, " "); n; n--)
	     selected[a[n]] = 1
	   next
	 }
	 NF > 0 {
	   if (selected[$ 1]) {
	     printf " %3d: %-18s %s\n", $ 1, $ 2, $ 3
	     if ($ 4) {
	       lmax = 79
	       indent = "     "
	       line = indent
	       len = length (line)
	       n = split ($ 4, a, " ")
	       for (i = 1; i <= n; i++) {
		 l = length (a[i]) + 1
		 if (i > 1 && len + l > lmax) {
		   print line
		   line = indent " " a[i]
		   len = length (line)
		 } else {
		   line = line " " a[i]
		   len += l
		 }
	       }
	       if (n)
		 print line
	     }
	   }
	 }' || at_write_fail=1
  exit $at_write_fail
fi
if $at_version_p; then
  $as_echo "$as_me (GNU Bison 2.4.1b)" &&
  cat <<\_ATEOF || at_write_fail=1

Copyright (C) 2009 Free Software Foundation, Inc.
This test suite is free software; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.
_ATEOF
  exit $at_write_fail
fi

# Should we print banners?  at_groups is space-separated for entire test,
# newline-separated if only a subset of the testsuite is run.
case $at_groups in
  *' '*' '* | *"$as_nl"*"$as_nl"* )
      at_print_banners=: ;;
  * ) at_print_banners=false ;;
esac
# Text for banner N, set to empty once printed.
# Banner 1. input.at:17
# Category starts at test group 1.
at_banner_text_1="Input Processing."
# Banner 2. output.at:17
# Category starts at test group 27.
at_banner_text_2="Output file names."
# Banner 3. skeletons.at:17
# Category starts at test group 62.
at_banner_text_3="Skeleton Support."
# Banner 4. sets.at:58
# Category starts at test group 68.
at_banner_text_4="Grammar Sets (Firsts etc.)."
# Banner 5. reduce.at:17
# Category starts at test group 72.
at_banner_text_5="Grammar Reduction."
# Banner 6. synclines.at:18
# Category starts at test group 78.
at_banner_text_6="User Actions."
# Banner 7. headers.at:18
# Category starts at test group 83.
at_banner_text_7="Parser Headers."
# Banner 8. actions.at:17
# Category starts at test group 87.
at_banner_text_8="User Actions."
# Banner 9. conflicts.at:19
# Category starts at test group 104.
at_banner_text_9="Conflicts."
# Banner 10. calc.at:559
# Category starts at test group 119.
at_banner_text_10="Simple LALR(1) Calculator."
# Banner 11. calc.at:596
# Category starts at test group 135.
at_banner_text_11="Simple GLR Calculator."
# Banner 12. calc.at:632
# Category starts at test group 149.
at_banner_text_12="Simple LALR(1) C++ Calculator."
# Banner 13. calc.at:659
# Category starts at test group 155.
at_banner_text_13="Simple GLR C++ Calculator."
# Banner 14. torture.at:18
# Category starts at test group 162.
at_banner_text_14="Torture Tests."
# Banner 15. existing.at:19
# Category starts at test group 167.
at_banner_text_15="Existing Grammars."
# Banner 16. regression.at:18
# Category starts at test group 170.
at_banner_text_16="Regression tests."
# Banner 17. c++.at:18
# Category starts at test group 195.
at_banner_text_17="C++ Features."
# Banner 18. java.at:18
# Category starts at test group 200.
at_banner_text_18="Java Calculator."
# Banner 19. java.at:407
# Category starts at test group 208.
at_banner_text_19="Java Parameters."
# Banner 20. cxx-type.at:17
# Category starts at test group 214.
at_banner_text_20="C++ Type Syntax (GLR)."
# Banner 21. glr-regression.at:18
# Category starts at test group 223.
at_banner_text_21="GLR Regression Tests"
# Banner 22. push.at:17
# Category starts at test group 241.
at_banner_text_22="Push Parsing Tests"

# Take any -C into account.
if $at_change_dir ; then
  if test x- = "x$at_dir" ; then
    at_dir=./-
  fi
  test x != "x$at_dir" && cd "$at_dir" \
    || as_fn_error "unable to change directory"
  at_dir=`pwd`
fi

# Load the config files for any default variable assignments.
for at_file in atconfig atlocal
do
  test -r $at_file || continue
  . ./$at_file || as_fn_error "invalid content: $at_file"
done

# Autoconf <=2.59b set at_top_builddir instead of at_top_build_prefix:
: ${at_top_build_prefix=$at_top_builddir}

# Perform any assignments requested during argument parsing.
eval "$at_debug_args"

# atconfig delivers names relative to the directory the test suite is
# in, but the groups themselves are run in testsuite-dir/group-dir.
if test -n "$at_top_srcdir"; then
  builddir=../..
  for at_dir_var in srcdir top_srcdir top_build_prefix
  do
    eval at_val=\$at_$at_dir_var
    case $at_val in
      [\\/$]* | ?:[\\/]* ) at_prefix= ;;
      *) at_prefix=../../ ;;
    esac
    eval "$at_dir_var=\$at_prefix\$at_val"
  done
fi

## -------------------- ##
## Directory structure. ##
## -------------------- ##

# This is the set of directories and files used by this script
# (non-literals are capitalized):
#
# TESTSUITE         - the testsuite
# TESTSUITE.log     - summarizes the complete testsuite run
# TESTSUITE.dir/    - created during a run, remains after -d or failed test
# + at-groups/      - during a run: status of all groups in run
# | + NNN/          - during a run: meta-data about test group NNN
# | | + check-line  - location (source file and line) of current AT_CHECK
# | | + status      - exit status of current AT_CHECK
# | | + stdout      - stdout of current AT_CHECK
# | | + stder1      - stderr, including trace
# | | + stderr      - stderr, with trace filtered out
# | | + test-source - portion of testsuite that defines group
# | | + times       - timestamps for computing duration
# | | + pass        - created if group passed
# | | + xpass       - created if group xpassed
# | | + fail        - created if group failed
# | | + xfail       - created if group xfailed
# | | + skip        - created if group skipped
# + at-stop         - during a run: end the run if this file exists
# + at-source-lines - during a run: cache of TESTSUITE line numbers for extraction
# + 0..NNN/         - created for each group NNN, remains after -d or failed test
# | + TESTSUITE.log - summarizes the group results
# | + ...           - files created during the group

# The directory the whole suite works in.
# Should be absolute to let the user `cd' at will.
at_suite_dir=$at_dir/$as_me.dir
# The file containing the suite.
at_suite_log=$at_dir/$as_me.log
# The directory containing helper files per test group.
at_helper_dir=$at_suite_dir/at-groups
# Stop file: if it exists, do not start new jobs.
at_stop_file=$at_suite_dir/at-stop
# The fifo used for the job dispatcher.
at_job_fifo=$at_suite_dir/at-job-fifo

if $at_clean; then
  test -d "$at_suite_dir" &&
    find "$at_suite_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \;
  rm -f -r "$at_suite_dir" "$at_suite_log"
  exit $?
fi

# Don't take risks: use only absolute directories in PATH.
#
# For stand-alone test suites (ie. atconfig was not found),
# AUTOTEST_PATH is relative to `.'.
#
# For embedded test suites, AUTOTEST_PATH is relative to the top level
# of the package.  Then expand it into build/src parts, since users
# may create executables in both places.
AUTOTEST_PATH=`$as_echo "$AUTOTEST_PATH" | sed "s|:|$PATH_SEPARATOR|g"`
at_path=
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $AUTOTEST_PATH $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
    test -n "$at_path" && as_fn_append at_path $PATH_SEPARATOR
case $as_dir in
  [\\/]* | ?:[\\/]* )
    as_fn_append at_path "$as_dir"
    ;;
  * )
    if test -z "$at_top_build_prefix"; then
      # Stand-alone test suite.
      as_fn_append at_path "$as_dir"
    else
      # Embedded test suite.
      as_fn_append at_path "$at_top_build_prefix$as_dir$PATH_SEPARATOR"
      as_fn_append at_path "$at_top_srcdir/$as_dir"
    fi
    ;;
esac
  done
IFS=$as_save_IFS


# Now build and simplify PATH.
#
# There might be directories that don't exist, but don't redirect
# builtins' (eg., cd) stderr directly: Ultrix's sh hates that.
at_new_path=
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $at_path
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
    test -d "$as_dir" || continue
case $as_dir in
  [\\/]* | ?:[\\/]* ) ;;
  * ) as_dir=`(cd "$as_dir" && pwd) 2>/dev/null` ;;
esac
case $PATH_SEPARATOR$at_new_path$PATH_SEPARATOR in
  *$PATH_SEPARATOR$as_dir$PATH_SEPARATOR*) ;;
  $PATH_SEPARATOR$PATH_SEPARATOR) at_new_path=$as_dir ;;
  *) as_fn_append at_new_path "$PATH_SEPARATOR$as_dir" ;;
esac
  done
IFS=$as_save_IFS

PATH=$at_new_path
export PATH

# Setting up the FDs.


# 5 is the log file.  Not to be overwritten if `-d'.
if $at_debug_p; then
  at_suite_log=/dev/null
else
  : >"$at_suite_log"
fi
exec 5>>"$at_suite_log"

# Banners and logs.
cat <<\_ASBOX
## ---------------------------- ##
## GNU Bison 2.4.1b test suite. ##
## ---------------------------- ##
_ASBOX
{
  cat <<\_ASBOX
## ---------------------------- ##
## GNU Bison 2.4.1b test suite. ##
## ---------------------------- ##
_ASBOX
  echo

  $as_echo "$as_me: command line was:"
  $as_echo "  \$ $0 $at_cli_args"
  echo

  # Try to find a few ChangeLogs in case it might help determining the
  # exact version.  Use the relative dir: if the top dir is a symlink,
  # find will not follow it (and options to follow the links are not
  # portable), which would result in no output here.  Prune directories
  # matching the package tarname, since they tend to be leftovers from
  # `make dist' or `make distcheck' and contain redundant or stale logs.
  if test -n "$at_top_srcdir"; then
    cat <<\_ASBOX
## ----------- ##
## ChangeLogs. ##
## ----------- ##
_ASBOX
    echo
    for at_file in `find "$at_top_srcdir" -name "bison-*" -prune -o -name ChangeLog -print`
    do
      $as_echo "$as_me: $at_file:"
      sed 's/^/| /;10q' $at_file
      echo
    done

  fi

  {
cat <<_ASUNAME
## --------- ##
## Platform. ##
## --------- ##

hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
uname -m = `(uname -m) 2>/dev/null || echo unknown`
uname -r = `(uname -r) 2>/dev/null || echo unknown`
uname -s = `(uname -s) 2>/dev/null || echo unknown`
uname -v = `(uname -v) 2>/dev/null || echo unknown`

/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`

/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`

_ASUNAME

as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
    $as_echo "PATH: $as_dir"
  done
IFS=$as_save_IFS

}
  echo

  # Contents of the config files.
  for at_file in atconfig atlocal
  do
    test -r $at_file || continue
    $as_echo "$as_me: $at_file:"
    sed 's/^/| /' $at_file
    echo
  done
} >&5


## ------------------------- ##
## Autotest shell functions. ##
## ------------------------- ##

# at_fn_banner NUMBER
# -------------------
# Output banner NUMBER, provided the testsuite is running multiple groups and
# this particular banner has not yet been printed.
at_fn_banner ()
{
  $at_print_banners || return 0
  eval at_banner_text=\$at_banner_text_$1
  test "x$at_banner_text" = x && return 0
  eval at_banner_text_$1=
  $as_echo "$as_nl$at_banner_text$as_nl"
} # at_fn_banner

# at_fn_check_prepare_notrace REASON LINE
# ---------------------------------------
# Perform AT_CHECK preparations for the command at LINE for an untraceable
# command; REASON is the reason for disabling tracing.
at_fn_check_prepare_notrace ()
{
  $at_trace_echo "Not enabling shell tracing (command contains $1)"
  $as_echo "$2" >"$at_check_line_file"
  at_check_trace=: at_check_filter=:
  : >"$at_stdout"; : >"$at_stderr"
}

# at_fn_check_prepare_trace LINE
# ------------------------------
# Perform AT_CHECK preparations for the command at LINE for a traceable
# command.
at_fn_check_prepare_trace ()
{
  $as_echo "$1" >"$at_check_line_file"
  at_check_trace=$at_traceon at_check_filter=$at_check_filter_trace
  : >"$at_stdout"; : >"$at_stderr"
}

# at_fn_check_prepare_dynamic COMMAND LINE
# ----------------------------------------
# Decide if COMMAND at LINE is traceable at runtime, and call the appropriate
# preparation function.
at_fn_check_prepare_dynamic ()
{
  case $1 in
    *$as_nl*)
      at_fn_check_prepare_notrace 'an embedded newline' "$2" ;;
    *)
      at_fn_check_prepare_trace "$2" ;;
  esac
}

# at_fn_filter_trace
# ------------------
# Remove the lines in the file "$at_stderr" generated by "set -x" and print
# them to stderr.
at_fn_filter_trace ()
{
  mv "$at_stderr" "$at_stder1"
  grep '^ *+' "$at_stder1" >&2
  grep -v '^ *+' "$at_stder1" >"$at_stderr"
}

# at_fn_log_failure FILE-LIST
# ---------------------------
# Copy the files in the list on stdout with a "> " prefix, and exit the shell
# with a failure exit code.
at_fn_log_failure ()
{
  for file
    do $as_echo "$file:"; sed 's/^/> /' "$file"; done
  echo 1 > "$at_status_file"
  exit 1
}

# at_fn_check_skip EXIT-CODE LINE
# -------------------------------
# Check whether EXIT-CODE is a special exit code (77 or 99), and if so exit
# the test group subshell with that same exit code. Use LINE in any report
# about test failure.
at_fn_check_skip ()
{
  case $1 in
    99) echo 99 > "$at_status_file"; at_failed=:
	$as_echo "$2: hard failure"; exit 99;;
    77) echo 77 > "$at_status_file"; exit 77;;
  esac
}

# at_fn_check_status EXPECTED EXIT-CODE LINE
# ------------------------------------------
# Check whether EXIT-CODE is the EXPECTED exit code, and if so do nothing.
# Otherwise, if it is 77 or 99, exit the test group subshell with that same
# exit code; if it is anything else print an error message referring to LINE,
# and fail the test.
at_fn_check_status ()
{
  case $2 in
    $1 ) ;;
    77) echo 77 > "$at_status_file"; exit 77;;
    99) echo 99 > "$at_status_file"; at_failed=:
	$as_echo "$3: hard failure"; exit 99;;
    *) $as_echo "$3: exit code was $2, expected $1"
      at_failed=:;;
  esac
}

# at_fn_diff_devnull FILE
# -----------------------
# Emit a diff between /dev/null and FILE. Uses "test -s" to avoid useless diff
# invocations.
at_fn_diff_devnull ()
{
  test -s "$1" || return 0
  $at_diff "$at_devnull" "$1"
}

# at_fn_test NUMBER
# -----------------
# Parse out test NUMBER from the tail of this file.
at_fn_test ()
{
  eval at_sed=\$at_sed$1
  sed "$at_sed" "$at_myself" > "$at_test_source"
}

# at_fn_create_debugging_script
# -----------------------------
# Create the debugging script $at_group_dir/run which will reproduce the
# current test group.
at_fn_create_debugging_script ()
{
  {
    echo "#! /bin/sh" &&
    echo 'test "${ZSH_VERSION+set}" = set && alias -g '\''${1+"$@"}'\''='\''"$@"'\''' &&
    $as_echo "cd '$at_dir'" &&
    $as_echo "exec \${CONFIG_SHELL-$SHELL} \"$at_myself\" -v -d $at_debug_args $at_group \${1+\"\$@\"}" &&
    echo 'exit 1'
  } >"$at_group_dir/run" &&
  chmod +x "$at_group_dir/run"
}

## -------------------------------- ##
## End of autotest shell functions. ##
## -------------------------------- ##
{
  cat <<\_ASBOX
## ---------------- ##
## Tested programs. ##
## ---------------- ##
_ASBOX
  echo
} >&5

# Report what programs are being tested.
for at_program in : $at_tested
do
  test "$at_program" = : && continue
  case $at_program in
    [\\/]* | ?:[\\/]* ) $at_program_=$at_program ;;
    * )
    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
  IFS=$as_save_IFS
  test -z "$as_dir" && as_dir=.
    test -f "$as_dir/$at_program" && break
  done
IFS=$as_save_IFS

    at_program_=$as_dir/$at_program ;;
  esac
  if test -f "$at_program_"; then
    {
      $as_echo "$at_srcdir/local.at:322: $at_program_ --version"
      "$at_program_" --version </dev/null
      echo
    } >&5 2>&1
  else
    as_fn_error "cannot find $at_program" "$LINENO" 5
  fi
done

{
  cat <<\_ASBOX
## ------------------ ##
## Running the tests. ##
## ------------------ ##
_ASBOX
} >&5

at_start_date=`date`
at_start_time=`date +%s 2>/dev/null`
$as_echo "$as_me: starting at: $at_start_date" >&5

# Create the master directory if it doesn't already exist.
as_dir="$at_suite_dir"; as_fn_mkdir_p ||
  as_fn_error "cannot create \`$at_suite_dir'" "$LINENO" 5

# Can we diff with `/dev/null'?  DU 5.0 refuses.
if diff /dev/null /dev/null >/dev/null 2>&1; then
  at_devnull=/dev/null
else
  at_devnull=$at_suite_dir/devnull
  >"$at_devnull"
fi

# Use `diff -u' when possible.
if at_diff=`diff -u "$at_devnull" "$at_devnull" 2>&1` && test -z "$at_diff"
then
  at_diff='diff -u'
else
  at_diff=diff
fi

# Get the last needed group.
for at_group in : $at_groups; do :; done

# Extract the start and end lines of each test group at the tail
# of this file
awk '
BEGIN { FS="" }
/^#AT_START_/ {
  start = NR
}
/^#AT_STOP_/ {
  test = substr ($ 0, 10)
  print "at_sed" test "=\"1," start "d;" (NR-1) "q\""
  if (test == "'"$at_group"'") exit
}' "$at_myself" > "$at_suite_dir/at-source-lines" &&
. "$at_suite_dir/at-source-lines" ||
  as_fn_error "cannot create test line number cache" "$LINENO" 5
rm -f "$at_suite_dir/at-source-lines"

# Set number of jobs for `-j'; avoid more jobs than test groups.
set X $at_groups; shift; at_max_jobs=$#
if test $at_max_jobs -eq 0; then
  at_jobs=1
fi
if test $at_jobs -ne 1 &&
   { test $at_jobs -eq 0 || test $at_jobs -gt $at_max_jobs; }; then
  at_jobs=$at_max_jobs
fi

# If parallel mode, don't output banners, don't split summary lines.
if test $at_jobs -ne 1; then
  at_print_banners=false
  at_quiet=:
fi

# Set up helper dirs.
rm -rf "$at_helper_dir" &&
mkdir "$at_helper_dir" &&
cd "$at_helper_dir" &&
{ test -z "$at_groups" || mkdir $at_groups; } ||
as_fn_error "testsuite directory setup failed" "$LINENO" 5

# Functions for running a test group.  We leave the actual
# test group execution outside of a shell function in order
# to avoid hitting zsh 4.x exit status bugs.

# at_fn_group_prepare
# -------------------
# Prepare running a test group.
at_fn_group_prepare ()
{
  # The directory for additional per-group helper files.
  at_job_dir=$at_helper_dir/$at_group
  # The file containing the location of the last AT_CHECK.
  at_check_line_file=$at_job_dir/check-line
  # The file containing the exit status of the last command.
  at_status_file=$at_job_dir/status
  # The files containing the output of the tested commands.
  at_stdout=$at_job_dir/stdout
  at_stder1=$at_job_dir/stder1
  at_stderr=$at_job_dir/stderr
  # The file containing the code for a test group.
  at_test_source=$at_job_dir/test-source
  # The file containing dates.
  at_times_file=$at_job_dir/times

  # Be sure to come back to the top test directory.
  cd "$at_suite_dir"

  # Clearly separate the test groups when verbose.
  $at_first || $at_verbose echo

  at_group_normalized=$at_group

  eval 'while :; do
    case $at_group_normalized in #(
    '"$at_format"'*) break;;
    esac
    at_group_normalized=0$at_group_normalized
  done'


  # Create a fresh directory for the next test group, and enter.
  # If one already exists, the user may have invoked ./run from
  # within that directory; we remove the contents, but not the
  # directory itself, so that we aren't pulling the rug out from
  # under the shell's notion of the current directory.
  at_group_dir=$at_suite_dir/$at_group_normalized
  at_group_log=$at_group_dir/$as_me.log
  if test -d "$at_group_dir"; then
  find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx {} \;
  rm -fr "$at_group_dir"/* "$at_group_dir"/.[!.] "$at_group_dir"/.??*
fi ||
    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: test directory for $at_group_normalized could not be cleaned." >&5
$as_echo "$as_me: WARNING: test directory for $at_group_normalized could not be cleaned." >&2;}
  # Be tolerant if the above `rm' was not able to remove the directory.
  as_dir="$at_group_dir"; as_fn_mkdir_p

  echo 0 > "$at_status_file"

  # In verbose mode, append to the log file *and* show on
  # the standard output; in quiet mode only write to the log.
  if test -z "$at_verbose"; then
    at_tee_pipe='tee -a "$at_group_log"'
  else
    at_tee_pipe='cat >> "$at_group_log"'
  fi
}

# at_fn_group_postprocess
# -----------------------
# Perform cleanup after running a test group.
at_fn_group_postprocess ()
{
  # Be sure to come back to the suite directory, in particular
  # since below we might `rm' the group directory we are in currently.
  cd "$at_suite_dir"

  if test ! -f "$at_check_line_file"; then
    sed "s/^ */$as_me: WARNING: /" <<_ATEOF
      A failure happened in a test group before any test could be
      run. This means that test suite is improperly designed.  Please
      report this failure to <bug-bison@gnu.org>.
_ATEOF
    $as_echo "$at_setup_line" >"$at_check_line_file"
    at_status=99
  fi
  $at_verbose $as_echo_n "$at_group. $at_setup_line: "
  $as_echo_n "$at_group. $at_setup_line: " >> "$at_group_log"
  case $at_xfail:$at_status in
    *:99)
	at_msg='FAILED ('`cat "$at_check_line_file"`')'
	at_res=fail
	at_errexit=$at_errexit_p
	;;
    yes:0)
	at_msg="UNEXPECTED PASS"
	at_res=xpass
	at_errexit=$at_errexit_p
	;;
    no:0)
	at_msg="ok"
	at_res=pass
	at_errexit=false
	;;
    *:77)
	at_msg='skipped ('`cat "$at_check_line_file"`')'
	at_res=skip
	at_errexit=false
	;;
    yes:*)
	at_msg='expected failure ('`cat "$at_check_line_file"`')'
	at_res=xfail
	at_errexit=false
	;;
    no:*)
	at_msg='FAILED ('`cat "$at_check_line_file"`')'
	at_res=fail
	at_errexit=$at_errexit_p
	;;
  esac
  echo "$at_res" > "$at_job_dir/$at_res"
  # In parallel mode, output the summary line only afterwards.
  if test $at_jobs -ne 1 && test -n "$at_verbose"; then
    $as_echo "$at_desc_line $at_msg"
  else
    # Make sure there is a separator even with long titles.
    $as_echo " $at_msg"
  fi
  at_log_msg="$at_group. $at_desc ($at_setup_line): $at_msg"
  case $at_status in
    0|77)
      # $at_times_file is only available if the group succeeded.
      # We're not including the group log, so the success message
      # is written in the global log separately.  But we also
      # write to the group log in case they're using -d.
      if test -f "$at_times_file"; then
	at_log_msg="$at_log_msg     ("`sed 1d "$at_times_file"`')'
	rm -f "$at_times_file"
      fi
      $as_echo "$at_log_msg" >> "$at_group_log"
      $as_echo "$at_log_msg" >&5

      # Cleanup the group directory, unless the user wants the files.
      if $at_debug_p; then
	at_fn_create_debugging_script
      else
	if test -d "$at_group_dir"; then
	  find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \;
	  rm -fr "$at_group_dir"
	fi
	rm -f "$at_test_source"
      fi
      ;;
    *)
      # Upon failure, include the log into the testsuite's global
      # log.  The failure message is written in the group log.  It
      # is later included in the global log.
      $as_echo "$at_log_msg" >> "$at_group_log"

      # Upon failure, keep the group directory for autopsy, and create
      # the debugging script.  With -e, do not start any further tests.
      at_fn_create_debugging_script
      if $at_errexit; then
	echo stop > "$at_stop_file"
      fi
      ;;
  esac
}


## ------------ ##
## Driver loop. ##
## ------------ ##


if (set -m && set +m && set +b) >/dev/null 2>&1; then
  set +b
  at_job_control_on='set -m' at_job_control_off='set +m' at_job_group=-
else
  at_job_control_on=: at_job_control_off=: at_job_group=
fi

for at_signal in 1 2 15; do
  trap 'set +x; set +e
	$at_job_control_off
	at_signal='"$at_signal"'
	echo stop > "$at_stop_file"
	trap "" $at_signal
	at_pgids=
	for at_pgid in `jobs -p 2>/dev/null`; do
	  at_pgids="$at_pgids $at_job_group$at_pgid"
	done
	test -z "$at_pgids" || kill -$at_signal $at_pgids 2>/dev/null
	wait
	if test "$at_jobs" -eq 1 || test -z "$at_verbose"; then
	  echo >&2
	fi
	at_signame=`kill -l $at_signal 2>&1 || echo $at_signal`
	set x $at_signame
	test 0 -gt 2 && at_signame=$at_signal
	{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: caught signal $at_signame, bailing out" >&5
$as_echo "$as_me: WARNING: caught signal $at_signame, bailing out" >&2;}
	as_fn_arith 128 + $at_signal && exit_status=$as_val
	as_fn_exit $exit_status' $at_signal
done

rm -f "$at_stop_file"
at_first=:

if test $at_jobs -ne 1 &&
     rm -f "$at_job_fifo" &&
     test -n "$at_job_group" &&
     ( mkfifo "$at_job_fifo" && trap 'exit 1' PIPE STOP TSTP ) 2>/dev/null
then
  # FIFO job dispatcher.

  trap 'at_pids=
	for at_pid in `jobs -p`; do
	  at_pids="$at_pids $at_job_group$at_pid"
	done
	if test -n "$at_pids"; then
	  at_sig=TSTP
	  test "${TMOUT+set}" = set && at_sig=STOP
	  kill -$at_sig $at_pids 2>/dev/null
	fi
	kill -STOP $$
	test -z "$at_pids" || kill -CONT $at_pids 2>/dev/null' TSTP

  echo
  # Turn jobs into a list of numbers, starting from 1.
  at_joblist=`$as_echo " $at_groups_all " | \
    sed 's/\( '$at_jobs'\) .*/\1/'`

  set X $at_joblist
  shift
  for at_group in $at_groups; do
    $at_job_control_on 2>/dev/null
    (
      # Start one test group.
      $at_job_control_off
      exec 6>"$at_job_fifo"
      trap 'set +x; set +e
	    trap "" PIPE
	    echo stop > "$at_stop_file"
	    echo token >&6
	    as_fn_exit 141' PIPE
      at_fn_group_prepare
      if cd "$at_group_dir" &&
	 at_fn_test $at_group &&
	 . "$at_test_source" # AT_JOB_FIFO_FD>&-
      then :; else
	{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to parse test group: $at_group" >&5
$as_echo "$as_me: WARNING: unable to parse test group: $at_group" >&2;}
	at_failed=:
      fi
      at_fn_group_postprocess
      echo token >&6
    ) &
    $at_job_control_off
    if $at_first; then
      at_first=false
      exec 6<"$at_job_fifo"
    fi
    shift # Consume one token.
    if test $# -gt 0; then :; else
      read at_token <&6 || break
      set x $*
    fi
    test -f "$at_stop_file" && break
  done
  # Read back the remaining ($at_jobs - 1) tokens.
  set X $at_joblist
  shift
  if test $# -gt 0; then
    shift
    for at_job
    do
      read at_token
    done <&6
  fi
  exec 6<&-
  wait
else
  # Run serially, avoid forks and other potential surprises.
  for at_group in $at_groups; do
    at_fn_group_prepare
    if cd "$at_group_dir" &&
       at_fn_test $at_group &&
       . "$at_test_source"; then :; else
      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to parse test group: $at_group" >&5
$as_echo "$as_me: WARNING: unable to parse test group: $at_group" >&2;}
      at_failed=:
    fi
    at_fn_group_postprocess
    test -f "$at_stop_file" && break
    at_first=false
  done
fi

# Wrap up the test suite with summary statistics.
cd "$at_helper_dir"

# Use ?..???? when the list must remain sorted, the faster * otherwise.
at_pass_list=`for f in */pass; do echo $f; done | sed '/\*/d; s,/pass,,'`
at_skip_list=`for f in */skip; do echo $f; done | sed '/\*/d; s,/skip,,'`
at_xfail_list=`for f in */xfail; do echo $f; done | sed '/\*/d; s,/xfail,,'`
at_xpass_list=`for f in ?/xpass ??/xpass ???/xpass ????/xpass; do
		 echo $f; done | sed '/?/d; s,/xpass,,'`
at_fail_list=`for f in ?/fail ??/fail ???/fail ????/fail; do
		echo $f; done | sed '/?/d; s,/fail,,'`

set X $at_pass_list $at_xpass_list $at_xfail_list $at_fail_list $at_skip_list
shift; at_group_count=$#
set X $at_xpass_list; shift; at_xpass_count=$#; at_xpass_list=$*
set X $at_xfail_list; shift; at_xfail_count=$#
set X $at_fail_list; shift; at_fail_count=$#; at_fail_list=$*
set X $at_skip_list; shift; at_skip_count=$#

as_fn_arith $at_group_count - $at_skip_count && at_run_count=$as_val
as_fn_arith $at_xpass_count + $at_fail_count && at_unexpected_count=$as_val
as_fn_arith $at_xfail_count + $at_fail_count && at_total_fail_count=$as_val

# Back to the top directory.
cd "$at_dir"
rm -rf "$at_helper_dir"

# Compute the duration of the suite.
at_stop_date=`date`
at_stop_time=`date +%s 2>/dev/null`
$as_echo "$as_me: ending at: $at_stop_date" >&5
case $at_start_time,$at_stop_time in
  [0-9]*,[0-9]*)
    as_fn_arith $at_stop_time - $at_start_time && at_duration_s=$as_val
    as_fn_arith $at_duration_s / 60 && at_duration_m=$as_val
    as_fn_arith $at_duration_m / 60 && at_duration_h=$as_val
    as_fn_arith $at_duration_s % 60 && at_duration_s=$as_val
    as_fn_arith $at_duration_m % 60 && at_duration_m=$as_val
    at_duration="${at_duration_h}h ${at_duration_m}m ${at_duration_s}s"
    $as_echo "$as_me: test suite duration: $at_duration" >&5
    ;;
esac

echo
cat <<\_ASBOX
## ------------- ##
## Test results. ##
## ------------- ##
_ASBOX
echo
{
  echo
  cat <<\_ASBOX
## ------------- ##
## Test results. ##
## ------------- ##
_ASBOX
  echo
} >&5

if test $at_run_count = 1; then
  at_result="1 test"
  at_were=was
else
  at_result="$at_run_count tests"
  at_were=were
fi
if $at_errexit_p && test $at_unexpected_count != 0; then
  if test $at_xpass_count = 1; then
    at_result="$at_result $at_were run, one passed"
  else
    at_result="$at_result $at_were run, one failed"
  fi
  at_result="$at_result unexpectedly and inhibited subsequent tests."
else
  # Don't you just love exponential explosion of the number of cases?
  case $at_xpass_count:$at_fail_count:$at_xfail_count in
    # So far, so good.
    0:0:0) at_result="$at_result $at_were successful." ;;
    0:0:*) at_result="$at_result behaved as expected." ;;

    # Some unexpected failures
    0:*:0) at_result="$at_result $at_were run,
$at_fail_count failed unexpectedly." ;;

    # Some failures, both expected and unexpected
    0:*:1) at_result="$at_result $at_were run,
$at_total_fail_count failed ($at_xfail_count expected failure)." ;;
    0:*:*) at_result="$at_result $at_were run,
$at_total_fail_count failed ($at_xfail_count expected failures)." ;;

    # No unexpected failures, but some xpasses
    *:0:*) at_result="$at_result $at_were run,
$at_xpass_count passed unexpectedly." ;;

    # No expected failures, but failures and xpasses
    *:1:0) at_result="$at_result $at_were run,
$at_unexpected_count did not behave as expected ($at_fail_count unexpected failure)." ;;
    *:*:0) at_result="$at_result $at_were run,
$at_unexpected_count did not behave as expected ($at_fail_count unexpected failures)." ;;

    # All of them.
    *:*:1) at_result="$at_result $at_were run,
$at_xpass_count passed unexpectedly,
$at_total_fail_count failed ($at_xfail_count expected failure)." ;;
    *:*:*) at_result="$at_result $at_were run,
$at_xpass_count passed unexpectedly,
$at_total_fail_count failed ($at_xfail_count expected failures)." ;;
  esac

  if test $at_skip_count = 0 && test $at_run_count -gt 1; then
    at_result="All $at_result"
  fi
fi

# Now put skips in the mix.
case $at_skip_count in
  0) ;;
  1) at_result="$at_result
1 test was skipped." ;;
  *) at_result="$at_result
$at_skip_count tests were skipped." ;;
esac

if test $at_unexpected_count = 0; then
  echo "$at_result"
  echo "$at_result" >&5
else
  echo "ERROR: $at_result" >&2
  echo "ERROR: $at_result" >&5
  {
    echo
    cat <<\_ASBOX
## ------------------------ ##
## Summary of the failures. ##
## ------------------------ ##
_ASBOX

    # Summary of failed and skipped tests.
    if test $at_fail_count != 0; then
      echo "Failed tests:"
      $SHELL "$at_myself" $at_fail_list --list
      echo
    fi
    if test $at_skip_count != 0; then
      echo "Skipped tests:"
      $SHELL "$at_myself" $at_skip_list --list
      echo
    fi
    if test $at_xpass_count != 0; then
      echo "Unexpected passes:"
      $SHELL "$at_myself" $at_xpass_list --list
      echo
    fi
    if test $at_fail_count != 0; then
      cat <<\_ASBOX
## ---------------------- ##
## Detailed failed tests. ##
## ---------------------- ##
_ASBOX
      echo
      for at_group in $at_fail_list
      do
	at_group_normalized=$at_group

  eval 'while :; do
    case $at_group_normalized in #(
    '"$at_format"'*) break;;
    esac
    at_group_normalized=0$at_group_normalized
  done'

	cat "$at_suite_dir/$at_group_normalized/$as_me.log"
	echo
      done
      echo
    fi
    if test -n "$at_top_srcdir"; then
      sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
## ${at_top_build_prefix}config.log ##
_ASBOX
      sed 's/^/| /' ${at_top_build_prefix}config.log
      echo
    fi
  } >&5

  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
## $as_me.log was created. ##
_ASBOX

  echo
  if $at_debug_p; then
    at_msg='per-test log files'
  else
    at_msg="\`${at_testdir+${at_testdir}/}$as_me.log'"
  fi
  $as_echo "Please send $at_msg and all information you think might help:

   To: <bug-bison@gnu.org>
   Subject: [GNU Bison 2.4.1b] $as_me: $at_fail_list${at_fail_list:+ failed${at_xpass_list:+, }}$at_xpass_list${at_xpass_list:+ passed unexpectedly}

You may investigate any problem if you feel able to do so, in which
case the test suite provides a good starting point.  Its output may
be found below \`${at_testdir+${at_testdir}/}$as_me.dir'.
"
  exit 1
fi

exit 0

## ------------- ##
## Actual tests. ##
## ------------- ##
#AT_START_1
# 1. input.at:26: Invalid $n and @n
at_setup_line='input.at:26'
at_fn_banner 1
at_desc="Invalid \$n and @n"
at_desc_line="  1: $at_desc                              "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "1. input.at:26: testing ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%%
exp: { $$ = $1 ; };
exp: { @$ = @1 ; };
_ATEOF



{ set +x
$as_echo "$at_srcdir/input.at:34: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:34"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:2.13-14: integer out of range: \`\$1'
input.y:3.13-14: integer out of range: \`@1'
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:34"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_1
#AT_START_2
# 2. input.at:46: Type Clashes
at_setup_line='input.at:46'
at_fn_banner 1
at_desc="Type Clashes"
at_desc_line="  2: $at_desc                                   "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "2. input.at:46: testing ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%union { int bar; }
%token foo
%type <bar> exp
%%
exp: foo { $$; } foo { $2; } foo
   | foo
   | /* Empty. */
   ;
_ATEOF



{ set +x
$as_echo "$at_srcdir/input.at:59: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:59"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:5.12-13: \$\$ for the midrule at \$2 of \`exp' has no declared type
input.y:5.24-25: \$2 of \`exp' has no declared type
input.y:5.6-32: warning: type clash on default action: <bar> != <>
input.y:6.6-8: warning: type clash on default action: <bar> != <>
input.y:7.5: warning: empty rule for typed nonterminal, and no action
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:59"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_2
#AT_START_3
# 3. input.at:160: Unused values
at_setup_line='input.at:160'
at_fn_banner 1
at_desc="Unused values"
at_desc_line="  3: $at_desc                                  "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "3. input.at:160: testing ..."
  $at_traceon

cat >input.y <<'_ATEOF'
%token <integer> INT;
%type <integer> a b c d e f g h i j k l;
%destructor { destroy ($$); } INT a b c d e f g h i j k l;
%%
start:
  'a' a { $2 } | 'b' b { $2 } | 'c' c { $2 } | 'd' d { $2 } | 'e' e { $2 }
| 'f' f { $2 } | 'g' g { $2 } | 'h' h { $2 } | 'i' i { $2 } | 'j' j { $2 }
| 'k' k { $2 } | 'l' l { $2 }
;

a: INT | INT { } INT { } INT { };
b: INT | /* empty */;
c: INT | INT { $1 } INT { $<integer>2 } INT { $<integer>4 };
d: INT | INT { } INT { $1 } INT { $<integer>2 };
e: INT | INT { } INT {  } INT { $1 };
f: INT | INT { } INT {  } INT { $$ = $1 + $3 + $5; };
g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
i: INT | INT INT { } { $$ = $1 + $2; };
j: INT | INT INT { $<integer>$ = 1; } { $$ = $1 + $2; };
k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
l: INT | INT { $<integer>$ = $<integer>1; } INT { $<integer>$ = $<integer>2 + $<integer>3; } INT { $<integer>$ = $<integer>4 + $<integer>5; };
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/input.at:161: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot  input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:161"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot  input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:161"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:161: bison --xml=xml-tests/test.xml  input.y"
at_fn_check_prepare_trace "input.at:161"
( $at_check_trace; bison --xml=xml-tests/test.xml  input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:161"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:161: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:161"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:161"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/input.at:161: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:161"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:161"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/input.at:161: bison  input.y"
at_fn_check_prepare_trace "input.at:161"
( $at_check_trace; bison  input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:11.10-32: warning: unset value: \$\$
input.y:11.10-32: warning: unused value: \$1
input.y:11.10-32: warning: unused value: \$3
input.y:11.10-32: warning: unused value: \$5
input.y:12.9: warning: empty rule for typed nonterminal, and no action
input.y:13.10-59: warning: unset value: \$\$
input.y:13.10-59: warning: unused value: \$3
input.y:13.10-59: warning: unused value: \$5
input.y:14.10-47: warning: unset value: \$\$
input.y:14.10-47: warning: unused value: \$3
input.y:14.10-47: warning: unused value: \$5
input.y:15.10-36: warning: unset value: \$\$
input.y:15.10-36: warning: unused value: \$3
input.y:15.10-36: warning: unused value: \$5
input.y:17.10-58: warning: unset value: \$\$
input.y:17.10-58: warning: unused value: \$1
input.y:17.10-58: warning: unused value: \$3
input.y:17.10-58: warning: unused value: \$5
input.y:18.10-72: warning: unset value: \$\$
input.y:18.10-72: warning: unused value: \$1
input.y:18.10-72: warning: unused value: \$3
input.y:18.10-72: warning: unused value: \$5
input.y:21.10-68: warning: unset value: \$\$
input.y:21.10-68: warning: unused value: \$1
input.y:21.10-68: warning: unused value: \$2
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:161"
$at_failed && at_fn_log_failure
$at_traceon; }

cat >input.y <<'_ATEOF'
%token <integer> INT;
%type <integer> a b c d e f g h i j k l;
%destructor { destroy ($$); } INT a b c d e f g h i j k l;
%%
start:
  'a' a { $2 } | 'b' b { $2 } | 'c' c { $2 } | 'd' d { $2 } | 'e' e { $2 }
| 'f' f { $2 } | 'g' g { $2 } | 'h' h { $2 } | 'i' i { $2 } | 'j' j { $2 }
| 'k' k { $2 } | 'l' l { $2 }
;

a: INT | INT { } INT { } INT { };
b: INT | /* empty */;
c: INT | INT { $1 } INT { $<integer>2 } INT { $<integer>4 };
d: INT | INT { } INT { $1 } INT { $<integer>2 };
e: INT | INT { } INT {  } INT { $1 };
f: INT | INT { } INT {  } INT { $$ = $1 + $3 + $5; };
g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
i: INT | INT INT { } { $$ = $1 + $2; };
j: INT | INT INT { $<integer>$ = 1; } { $$ = $1 + $2; };
k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
l: INT | INT { $<integer>$ = $<integer>1; } INT { $<integer>$ = $<integer>2 + $<integer>3; } INT { $<integer>$ = $<integer>4 + $<integer>5; };
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/input.at:162: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot  --warnings=midrule-values  input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:162"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot  --warnings=midrule-values  input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:162"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:162: bison --xml=xml-tests/test.xml  --warnings=midrule-values  input.y"
at_fn_check_prepare_trace "input.at:162"
( $at_check_trace; bison --xml=xml-tests/test.xml  --warnings=midrule-values  input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:162"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:162: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:162"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:162"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/input.at:162: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:162"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:162"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/input.at:162: bison  --warnings=midrule-values  input.y"
at_fn_check_prepare_trace "input.at:162"
( $at_check_trace; bison  --warnings=midrule-values  input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:11.10-32: warning: unset value: \$\$
input.y:11.10-32: warning: unused value: \$1
input.y:11.10-32: warning: unused value: \$3
input.y:11.10-32: warning: unused value: \$5
input.y:12.9: warning: empty rule for typed nonterminal, and no action
input.y:13.14-19: warning: unset value: \$\$
input.y:13.25-39: warning: unset value: \$\$
input.y:13.10-59: warning: unset value: \$\$
input.y:13.10-59: warning: unused value: \$3
input.y:13.10-59: warning: unused value: \$5
input.y:14.14-16: warning: unset value: \$\$
input.y:14.10-47: warning: unset value: \$\$
input.y:14.10-47: warning: unused value: \$3
input.y:14.10-47: warning: unused value: \$5
input.y:15.10-36: warning: unset value: \$\$
input.y:15.10-36: warning: unused value: \$3
input.y:15.10-36: warning: unused value: \$5
input.y:17.10-58: warning: unset value: \$\$
input.y:17.10-58: warning: unused value: \$1
input.y:17.10-58: warning: unused value: \$2
input.y:17.10-58: warning: unused value: \$3
input.y:17.10-58: warning: unused value: \$4
input.y:17.10-58: warning: unused value: \$5
input.y:18.10-72: warning: unset value: \$\$
input.y:18.10-72: warning: unused value: \$1
input.y:18.10-72: warning: unused value: \$3
input.y:18.10-72: warning: unused value: \$4
input.y:18.10-72: warning: unused value: \$5
input.y:20.10-55: warning: unused value: \$3
input.y:21.10-68: warning: unset value: \$\$
input.y:21.10-68: warning: unused value: \$1
input.y:21.10-68: warning: unused value: \$2
input.y:21.10-68: warning: unused value: \$4
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:162"
$at_failed && at_fn_log_failure
$at_traceon; }

  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_3
#AT_START_4
# 4. input.at:170: Unused values before symbol declarations
at_setup_line='input.at:170'
at_fn_banner 1
at_desc="Unused values before symbol declarations"
at_desc_line="  4: $at_desc       "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "4. input.at:170: testing ..."
  $at_traceon

cat >input.y <<'_ATEOF'



%%
start:
  'a' a { $2 } | 'b' b { $2 } | 'c' c { $2 } | 'd' d { $2 } | 'e' e { $2 }
| 'f' f { $2 } | 'g' g { $2 } | 'h' h { $2 } | 'i' i { $2 } | 'j' j { $2 }
| 'k' k { $2 } | 'l' l { $2 }
;

a: INT | INT { } INT { } INT { };
b: INT | /* empty */;
c: INT | INT { $1 } INT { $<integer>2 } INT { $<integer>4 };
d: INT | INT { } INT { $1 } INT { $<integer>2 };
e: INT | INT { } INT {  } INT { $1 };
f: INT | INT { } INT {  } INT { $$ = $1 + $3 + $5; };
g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
i: INT | INT INT { } { $$ = $1 + $2; };
j: INT | INT INT { $<integer>$ = 1; } { $$ = $1 + $2; };
k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
l: INT | INT { $<integer>$ = $<integer>1; } INT { $<integer>$ = $<integer>2 + $<integer>3; } INT { $<integer>$ = $<integer>4 + $<integer>5; };
%token <integer> INT;
%type <integer> a b c d e f g h i j k l;
%destructor { destroy ($$); } INT a b c d e f g h i j k l;
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/input.at:171: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot  input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:171"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot  input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:171"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:171: bison --xml=xml-tests/test.xml  input.y"
at_fn_check_prepare_trace "input.at:171"
( $at_check_trace; bison --xml=xml-tests/test.xml  input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:171"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:171: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:171"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:171"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/input.at:171: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:171"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:171"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/input.at:171: bison  input.y"
at_fn_check_prepare_trace "input.at:171"
( $at_check_trace; bison  input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:11.10-32: warning: unset value: \$\$
input.y:11.10-32: warning: unused value: \$1
input.y:11.10-32: warning: unused value: \$3
input.y:11.10-32: warning: unused value: \$5
input.y:12.9: warning: empty rule for typed nonterminal, and no action
input.y:13.10-59: warning: unset value: \$\$
input.y:13.10-59: warning: unused value: \$3
input.y:13.10-59: warning: unused value: \$5
input.y:14.10-47: warning: unset value: \$\$
input.y:14.10-47: warning: unused value: \$3
input.y:14.10-47: warning: unused value: \$5
input.y:15.10-36: warning: unset value: \$\$
input.y:15.10-36: warning: unused value: \$3
input.y:15.10-36: warning: unused value: \$5
input.y:17.10-58: warning: unset value: \$\$
input.y:17.10-58: warning: unused value: \$1
input.y:17.10-58: warning: unused value: \$3
input.y:17.10-58: warning: unused value: \$5
input.y:18.10-72: warning: unset value: \$\$
input.y:18.10-72: warning: unused value: \$1
input.y:18.10-72: warning: unused value: \$3
input.y:18.10-72: warning: unused value: \$5
input.y:21.10-68: warning: unset value: \$\$
input.y:21.10-68: warning: unused value: \$1
input.y:21.10-68: warning: unused value: \$2
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:171"
$at_failed && at_fn_log_failure
$at_traceon; }

cat >input.y <<'_ATEOF'



%%
start:
  'a' a { $2 } | 'b' b { $2 } | 'c' c { $2 } | 'd' d { $2 } | 'e' e { $2 }
| 'f' f { $2 } | 'g' g { $2 } | 'h' h { $2 } | 'i' i { $2 } | 'j' j { $2 }
| 'k' k { $2 } | 'l' l { $2 }
;

a: INT | INT { } INT { } INT { };
b: INT | /* empty */;
c: INT | INT { $1 } INT { $<integer>2 } INT { $<integer>4 };
d: INT | INT { } INT { $1 } INT { $<integer>2 };
e: INT | INT { } INT {  } INT { $1 };
f: INT | INT { } INT {  } INT { $$ = $1 + $3 + $5; };
g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
i: INT | INT INT { } { $$ = $1 + $2; };
j: INT | INT INT { $<integer>$ = 1; } { $$ = $1 + $2; };
k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
l: INT | INT { $<integer>$ = $<integer>1; } INT { $<integer>$ = $<integer>2 + $<integer>3; } INT { $<integer>$ = $<integer>4 + $<integer>5; };
%token <integer> INT;
%type <integer> a b c d e f g h i j k l;
%destructor { destroy ($$); } INT a b c d e f g h i j k l;
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/input.at:172: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot  --warnings=midrule-values  input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:172"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot  --warnings=midrule-values  input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:172"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:172: bison --xml=xml-tests/test.xml  --warnings=midrule-values  input.y"
at_fn_check_prepare_trace "input.at:172"
( $at_check_trace; bison --xml=xml-tests/test.xml  --warnings=midrule-values  input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:172"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:172: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:172"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:172"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/input.at:172: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:172"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:172"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/input.at:172: bison  --warnings=midrule-values  input.y"
at_fn_check_prepare_trace "input.at:172"
( $at_check_trace; bison  --warnings=midrule-values  input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:11.10-32: warning: unset value: \$\$
input.y:11.10-32: warning: unused value: \$1
input.y:11.10-32: warning: unused value: \$3
input.y:11.10-32: warning: unused value: \$5
input.y:12.9: warning: empty rule for typed nonterminal, and no action
input.y:13.14-19: warning: unset value: \$\$
input.y:13.25-39: warning: unset value: \$\$
input.y:13.10-59: warning: unset value: \$\$
input.y:13.10-59: warning: unused value: \$3
input.y:13.10-59: warning: unused value: \$5
input.y:14.14-16: warning: unset value: \$\$
input.y:14.10-47: warning: unset value: \$\$
input.y:14.10-47: warning: unused value: \$3
input.y:14.10-47: warning: unused value: \$5
input.y:15.10-36: warning: unset value: \$\$
input.y:15.10-36: warning: unused value: \$3
input.y:15.10-36: warning: unused value: \$5
input.y:17.10-58: warning: unset value: \$\$
input.y:17.10-58: warning: unused value: \$1
input.y:17.10-58: warning: unused value: \$2
input.y:17.10-58: warning: unused value: \$3
input.y:17.10-58: warning: unused value: \$4
input.y:17.10-58: warning: unused value: \$5
input.y:18.10-72: warning: unset value: \$\$
input.y:18.10-72: warning: unused value: \$1
input.y:18.10-72: warning: unused value: \$3
input.y:18.10-72: warning: unused value: \$4
input.y:18.10-72: warning: unused value: \$5
input.y:20.10-55: warning: unused value: \$3
input.y:21.10-68: warning: unset value: \$\$
input.y:21.10-68: warning: unused value: \$1
input.y:21.10-68: warning: unused value: \$2
input.y:21.10-68: warning: unused value: \$4
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:172"
$at_failed && at_fn_log_failure
$at_traceon; }

  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_4
#AT_START_5
# 5. input.at:180: Default %printer and %destructor redeclared
at_setup_line='input.at:180'
at_fn_banner 1
at_desc="Default %printer and %destructor redeclared"
at_desc_line="  5: $at_desc    "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "5. input.at:180: testing ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%destructor { destroy ($$); } <*> <*>
%printer { destroy ($$); } <*> <*>

%destructor { destroy ($$); } <*>
%printer { destroy ($$); } <*>

%destructor { destroy ($$); } <> <>
%printer { destroy ($$); } <> <>

%destructor { destroy ($$); } <>
%printer { destroy ($$); } <>

%%

start: ;

%destructor { destroy ($$); } <*>;
%printer { destroy ($$); } <*>;

%destructor { destroy ($$); } <>;
%printer { destroy ($$); } <>;
_ATEOF



{ set +x
$as_echo "$at_srcdir/input.at:206: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:206"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:1.13-29: redeclaration for default tagged %destructor
input.y:1.13-29: previous declaration
input.y:2.10-26: redeclaration for default tagged %printer
input.y:2.10-26: previous declaration
input.y:4.13-29: redeclaration for default tagged %destructor
input.y:1.13-29: previous declaration
input.y:5.10-26: redeclaration for default tagged %printer
input.y:2.10-26: previous declaration
input.y:7.13-29: redeclaration for default tagless %destructor
input.y:7.13-29: previous declaration
input.y:8.10-26: redeclaration for default tagless %printer
input.y:8.10-26: previous declaration
input.y:10.13-29: redeclaration for default tagless %destructor
input.y:7.13-29: previous declaration
input.y:11.10-26: redeclaration for default tagless %printer
input.y:8.10-26: previous declaration
input.y:17.13-29: redeclaration for default tagged %destructor
input.y:4.13-29: previous declaration
input.y:18.10-26: redeclaration for default tagged %printer
input.y:5.10-26: previous declaration
input.y:20.13-29: redeclaration for default tagless %destructor
input.y:10.13-29: previous declaration
input.y:21.10-26: redeclaration for default tagless %printer
input.y:11.10-26: previous declaration
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:206"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_5
#AT_START_6
# 6. input.at:240: Per-type %printer and %destructor redeclared
at_setup_line='input.at:240'
at_fn_banner 1
at_desc="Per-type %printer and %destructor redeclared"
at_desc_line="  6: $at_desc   "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "6. input.at:240: testing ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%destructor { destroy ($$); } <field1> <field2>
%printer { destroy ($$); } <field1> <field2>

%destructor { destroy ($$); } <field1> <field1>
%printer { destroy ($$); } <field2> <field2>

%%

start: ;

%destructor { destroy ($$); } <field2> <field1>;
%printer { destroy ($$); } <field2> <field1>;
_ATEOF



{ set +x
$as_echo "$at_srcdir/input.at:257: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:257"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:4.13-29: %destructor redeclaration for <field1>
input.y:1.13-29: previous declaration
input.y:4.13-29: %destructor redeclaration for <field1>
input.y:4.13-29: previous declaration
input.y:5.10-26: %printer redeclaration for <field2>
input.y:2.10-26: previous declaration
input.y:5.10-26: %printer redeclaration for <field2>
input.y:5.10-26: previous declaration
input.y:11.13-29: %destructor redeclaration for <field1>
input.y:4.13-29: previous declaration
input.y:11.13-29: %destructor redeclaration for <field2>
input.y:1.13-29: previous declaration
input.y:12.10-26: %printer redeclaration for <field1>
input.y:2.10-26: previous declaration
input.y:12.10-26: %printer redeclaration for <field2>
input.y:5.10-26: previous declaration
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:257"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_6
#AT_START_7
# 7. input.at:283: Unused values with default %destructor
at_setup_line='input.at:283'
at_fn_banner 1
at_desc="Unused values with default %destructor"
at_desc_line="  7: $at_desc         "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "7. input.at:283: testing ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%destructor { destroy ($$); } <>
%type <tag> tagged

%%

start: end end tagged tagged { $<tag>1; $3; } ;
end: { } ;
tagged: { } ;
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/input.at:296: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:296"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:296"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:296: bison --xml=xml-tests/test.xml input.y"
at_fn_check_prepare_trace "input.at:296"
( $at_check_trace; bison --xml=xml-tests/test.xml input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:296"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:296: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:296"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:296"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/input.at:296: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:296"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:296"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/input.at:296: bison input.y"
at_fn_check_prepare_trace "input.at:296"
( $at_check_trace; bison input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:6.8-45: warning: unset value: \$\$
input.y:6.8-45: warning: unused value: \$2
input.y:7.6-8: warning: unset value: \$\$
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:296"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input.y <<'_ATEOF'
%destructor { destroy ($$); } <*>
%type <tag> tagged

%%

start: end end tagged tagged { $<tag>1; $3; } ;
end: { } ;
tagged: { } ;
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/input.at:313: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:313"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:313"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:313: bison --xml=xml-tests/test.xml input.y"
at_fn_check_prepare_trace "input.at:313"
( $at_check_trace; bison --xml=xml-tests/test.xml input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:313"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:313: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:313"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:313"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/input.at:313: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:313"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:313"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/input.at:313: bison input.y"
at_fn_check_prepare_trace "input.at:313"
( $at_check_trace; bison input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:6.8-45: warning: unused value: \$4
input.y:8.9-11: warning: unset value: \$\$
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:313"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_7
#AT_START_8
# 8. input.at:325: Unused values with per-type %destructor
at_setup_line='input.at:325'
at_fn_banner 1
at_desc="Unused values with per-type %destructor"
at_desc_line="  8: $at_desc        "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "8. input.at:325: testing ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%destructor { destroy ($$); } <field1>
%type <field1> start end

%%

start: end end { $1; } ;
end: { }  ;
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/input.at:337: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:337"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:337"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:337: bison --xml=xml-tests/test.xml input.y"
at_fn_check_prepare_trace "input.at:337"
( $at_check_trace; bison --xml=xml-tests/test.xml input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:337"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:337: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:337"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:337"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/input.at:337: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:337"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:337"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/input.at:337: bison input.y"
at_fn_check_prepare_trace "input.at:337"
( $at_check_trace; bison input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:6.8-22: warning: unset value: \$\$
input.y:6.8-22: warning: unused value: \$2
input.y:7.6-8: warning: unset value: \$\$
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:337"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_8
#AT_START_9
# 9. input.at:350: Incompatible Aliases
at_setup_line='input.at:350'
at_fn_banner 1
at_desc="Incompatible Aliases"
at_desc_line="  9: $at_desc                           "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "9. input.at:350: testing ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%token foo "foo"

%type <bar>       foo
%printer {bar}    foo
%destructor {bar} foo
%left             foo

%type <baz>       "foo"
%printer {baz}    "foo"
%destructor {baz} "foo"
%left             "foo"

%%
exp: foo;
_ATEOF



{ set +x
$as_echo "$at_srcdir/input.at:369: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:369"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:8.7-11: %type redeclaration for foo
input.y:3.7-11: previous declaration
input.y:10.13-17: %destructor redeclaration for foo
input.y:5.13-17: previous declaration
input.y:9.10-14: %printer redeclaration for foo
input.y:4.10-14: previous declaration
input.y:11.1-5: %left redeclaration for foo
input.y:6.1-5: previous declaration
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_9
#AT_START_10
# 10. input.at:391: Torturing the Scanner
at_setup_line='input.at:391'
at_fn_banner 1
at_desc="Torturing the Scanner"
at_desc_line=" 10: $at_desc                          "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "10. input.at:391: testing ..."
  $at_traceon



cat >input.y <<'_ATEOF'
_ATEOF


{ set +x
$as_echo "$at_srcdir/input.at:395: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:395"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:1.1: syntax error, unexpected end of file
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:395"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >input.y <<'_ATEOF'
{}
_ATEOF


{ set +x
$as_echo "$at_srcdir/input.at:403: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:403"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:1.1-2: syntax error, unexpected {...}
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:403"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%{
/* This is seen in GCC: a %{ and %} in middle of a comment. */
const char *foo = "So %{ and %} can be here too.";

#if 0
/* These examples test Bison while not stressing C compilers too much.
   Many C compilers mishandle backslash-newlines, so this part of the
   test is inside "#if 0".  The comment and string are written so that
   the "#endif" will be seen regardless of the C compiler bugs that we
   know about, namely:

     HP C (as of late 2002) mishandles *\[newline]\[newline]/ within a
     comment.

     The Apple Darwin compiler (as of late 2002) mishandles
     \\[newline]' within a character constant.

   */

/\
* A comment with backslash-newlines in it. %} *\
\
/
/* { Close the above comment, if the C compiler mishandled it.  */

char str[] = "\\
" A string with backslash-newlines in it %{ %} \\
\
"";

char apostrophe = '\'';
#endif

#include <stdio.h>
#include <stdlib.h>
%}
/* %{ and %} can be here too. */

%{
/* Exercise pre-prologue dependency to %union.  */
typedef int value;
%}

/* Exercise M4 quoting: ']]', 0.  */

/* Also exercise %union. */
%union
{
  value ival; /* A comment to exercise an old bug. */
};


/* Exercise post-prologue dependency to %union.  */
%{
static YYSTYPE value_as_yystype (value val);

/* Exercise quotes in declarations.  */
char quote[] = "]],";
%}

%{
static void yyerror (const char *s);
static int yylex (void);
%}

%type <ival> '['

/* Exercise quotes in strings.  */
%token FAKE "fake [] \a\b\f\n\r\t\v\"\'\?\\\u005B\U0000005c ??!??'??(??)??-??/??<??=??> \x1\1"

%%
/* Exercise M4 quoting: ']]', [, 1.  */
exp: '[' '\1' two '$' '@' '{' oline output.or.oline.opt
  {
    /* Exercise quotes in braces.  */
    char tmp[] = "[%c],\n";
    printf (tmp, $1);
  }
;

two: '\x000000000000000000000000000000000000000000000000000000000000000000002';
oline: '@' 'o' 'l' 'i' 'n' 'e' '@' '_' '_' 'o' 'l' 'i' 'n' 'e' '_' '_';
output.or.oline.opt: ;|oline;;|output;;;
output: '#' 'o' 'u' 't' 'p' 'u' 't' ' ';
%%
/* Exercise M4 quoting: ']]', [, 2.  */

static YYSTYPE
value_as_yystype (value val)
{
  YYSTYPE res;
  res.ival = val;
  return res;
}

static int
yylex (void)
{
  static char const input[] = "[\1\2$@{@oline@__oline__\
#output "; /* "
  */
  static size_t toknum;
  if (! (toknum < sizeof input))
    abort ();
  yylval = value_as_yystype (input[toknum]);
  return input[toknum++];
}

static void
yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}
_ATEOF



# Pacify Emacs'font-lock-mode: "

cat >main.c <<'_ATEOF'
typedef int value;
#include "input.h"

int yyparse (void);

int
main (void)
{
  return yyparse ();
}
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/input.at:539: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -d -v -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:539"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -d -v -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:539"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:539: bison --xml=xml-tests/test.xml -d -v -o input.c input.y"
at_fn_check_prepare_trace "input.at:539"
( $at_check_trace; bison --xml=xml-tests/test.xml -d -v -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:539"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:539: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:539"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:539"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/input.at:539: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:539"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:539"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/input.at:539: bison -d -v -o input.c input.y"
at_fn_check_prepare_trace "input.at:539"
( $at_check_trace; bison -d -v -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:539"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/input.at:540: \$CC \$CFLAGS \$CPPFLAGS -o input.o -c input.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -o input.o -c input.c" "input.at:540"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -o input.o -c input.c
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:540"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/input.at:541: \$CC \$CFLAGS \$CPPFLAGS -o main.o -c main.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -o main.o -c main.c" "input.at:541"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -o main.o -c main.c
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:541"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/input.at:542: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.o main.o \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.o main.o $LIBS" "input.at:542"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.o main.o $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:542"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/input.at:543:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "input.at:543"
( $at_check_trace;  $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "[[],
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:543"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_10
#AT_START_11
# 11. input.at:554: Typed symbol aliases
at_setup_line='input.at:554'
at_fn_banner 1
at_desc="Typed symbol aliases"
at_desc_line=" 11: $at_desc                           "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "11. input.at:554: testing ..."
  $at_traceon


# Bison 2.0 broke typed symbol aliases - ensure they work.

cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%union
{
  int val;
};
%token <val> MY_TOKEN "MY TOKEN"
%type <val> exp
%%
exp: "MY TOKEN";
%%
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/input.at:570: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:570"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:570"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:570: bison --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_trace "input.at:570"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:570"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:570: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:570"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:570"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/input.at:570: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:570"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:570"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/input.at:570: bison -o input.c input.y"
at_fn_check_prepare_trace "input.at:570"
( $at_check_trace; bison -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:570"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_11
#AT_START_12
# 12. input.at:590: Require 1.0
at_setup_line='input.at:590'
at_fn_banner 1
at_desc="Require 1.0"
at_desc_line=" 12: $at_desc                                    "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "12. input.at:590: testing ..."
  $at_traceon

cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%require "1.0";
%%
empty_file:;
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/input.at:590: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:590"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:590"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:590: bison --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_trace "input.at:590"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:590"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:590: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:590"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:590"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/input.at:590: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:590"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:590"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/input.at:590: bison -o input.c input.y"
at_fn_check_prepare_trace "input.at:590"
( $at_check_trace; bison -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:590"
$at_failed && at_fn_log_failure
$at_traceon; }

  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_12
#AT_START_13
# 13. input.at:591: Require 2.4.1b
at_setup_line='input.at:591'
at_fn_banner 1
at_desc="Require 2.4.1b"
at_desc_line=" 13: $at_desc                                 "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "13. input.at:591: testing ..."
  $at_traceon

cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%require "2.4.1b";
%%
empty_file:;
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/input.at:591: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:591"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:591"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:591: bison --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_trace "input.at:591"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:591"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:591: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:591"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:591"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/input.at:591: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:591"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:591"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/input.at:591: bison -o input.c input.y"
at_fn_check_prepare_trace "input.at:591"
( $at_check_trace; bison -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:591"
$at_failed && at_fn_log_failure
$at_traceon; }

  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_13
#AT_START_14
# 14. input.at:593: Require 100.0
at_setup_line='input.at:593'
at_fn_banner 1
at_desc="Require 100.0"
at_desc_line=" 14: $at_desc                                  "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "14. input.at:593: testing ..."
  $at_traceon

cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%require "100.0";
%%
empty_file:;
_ATEOF



{ set +x
$as_echo "$at_srcdir/input.at:593: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y" "input.at:593"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 63 $at_status "$at_srcdir/input.at:593"
$at_failed && at_fn_log_failure
$at_traceon; }

  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_14
#AT_START_15
# 15. input.at:600: String aliases for character tokens
at_setup_line='input.at:600'
at_fn_banner 1
at_desc="String aliases for character tokens"
at_desc_line=" 15: $at_desc            "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "15. input.at:600: testing ..."
  $at_traceon


# Bison once thought a character token and its alias were different symbols
# with the same user token number.

cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%token 'a' "a"
%%
start: 'a';
%%
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/input.at:612: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:612"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:612"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:612: bison --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_trace "input.at:612"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:612"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:612: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:612"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:612"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/input.at:612: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:612"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:612"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/input.at:612: bison -o input.c input.y"
at_fn_check_prepare_trace "input.at:612"
( $at_check_trace; bison -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:612"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_15
#AT_START_16
# 16. input.at:621: Unclosed constructs
at_setup_line='input.at:621'
at_fn_banner 1
at_desc="Unclosed constructs"
at_desc_line=" 16: $at_desc                            "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "16. input.at:621: testing ..."
  $at_traceon


# Bison's scan-gram.l once forgot to STRING_FINISH some unclosed constructs, so
# they were prepended to whatever it STRING_GROW'ed next.  It also threw them
# away rather than returning them to the parser.  The effect was confusing
# subsequent error messages.

cat >input.y <<'_ATEOF'
%token A "a
%token B "b"
%token AB "ab" // Used to complain that "ab" was already used.
%token C '1
%token TWO "2"
%token TICK_TWELVE "'12" // Used to complain that "'12" was already used.

%%

start: ;

// Used to report a syntax error because it didn't see any kind of symbol
// identifier.
%type <f> 'a
;
%type <f> "a
;
// Used to report a syntax error because it didn't see braced code.
%destructor { free ($$)
_ATEOF



{ set +x
$as_echo "$at_srcdir/input.at:650: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y" "input.at:650"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:1.10-2.0: missing \`\"' at end of line
input.y:4.10-5.0: missing \`'' at end of line
input.y:14.11-15.0: missing \`'' at end of line
input.y:16.11-17.0: missing \`\"' at end of line
input.y:19.13-20.0: missing \`}' at end of file
input.y:20.1: syntax error, unexpected end of file
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:650"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_16
#AT_START_17
# 17. input.at:666: %start after first rule
at_setup_line='input.at:666'
at_fn_banner 1
at_desc="%start after first rule"
at_desc_line=" 17: $at_desc                        "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "17. input.at:666: testing ..."
  $at_traceon


# Bison once complained that a %start after the first rule was a redeclaration
# of the start symbol.

cat >input.y <<'_ATEOF'
%%
false_start: ;
start: false_start ;
%start start;
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/input.at:678: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:678"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:678"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:678: bison --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_trace "input.at:678"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:678"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:678: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:678"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:678"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/input.at:678: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:678"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:678"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/input.at:678: bison -o input.c input.y"
at_fn_check_prepare_trace "input.at:678"
( $at_check_trace; bison -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:678"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_17
#AT_START_18
# 18. input.at:687: %prec takes a token
at_setup_line='input.at:687'
at_fn_banner 1
at_desc="%prec takes a token"
at_desc_line=" 18: $at_desc                            "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "18. input.at:687: testing ..."
  $at_traceon


# Bison once allowed %prec sym where sym was a nonterminal.

cat >input.y <<'_ATEOF'
%%
start: PREC %prec PREC ;
PREC: ;
_ATEOF



{ set +x
$as_echo "$at_srcdir/input.at:697: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:697"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:3.1-4: rule given for PREC, which is a token
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:697"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_18
#AT_START_19
# 19. input.at:708: %prec's token must be defined
at_setup_line='input.at:708'
at_fn_banner 1
at_desc="%prec's token must be defined"
at_desc_line=" 19: $at_desc                  "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "19. input.at:708: testing ..."
  $at_traceon


# According to POSIX, a %prec token must be defined separately.

cat >input.y <<'_ATEOF'
%%
start: %prec PREC ;
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/input.at:717: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:717"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:717"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:717: bison --xml=xml-tests/test.xml input.y"
at_fn_check_prepare_trace "input.at:717"
( $at_check_trace; bison --xml=xml-tests/test.xml input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:717"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:717: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:717"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:717"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/input.at:717: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:717"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:717"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/input.at:717: bison input.y"
at_fn_check_prepare_trace "input.at:717"
( $at_check_trace; bison input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:2.8-17: warning: token for %prec is not defined: PREC
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:717"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_19
#AT_START_20
# 20. input.at:728: Reject unused %code qualifiers
at_setup_line='input.at:728'
at_fn_banner 1
at_desc="Reject unused %code qualifiers"
at_desc_line=" 20: $at_desc                 "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "20. input.at:728: testing ..."
  $at_traceon


cat >input-c.y <<'_ATEOF'
%code q {}
%code bad {}
%code bad {}
%code format {}
%%
start: ;
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/input.at:738: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot input-c.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:738"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot input-c.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:738"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:738: bison --xml=xml-tests/test.xml input-c.y"
at_fn_check_prepare_trace "input.at:738"
( $at_check_trace; bison --xml=xml-tests/test.xml input-c.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:738"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:738: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:738"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:738"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/input.at:738: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:738"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:738"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/input.at:738: bison input-c.y"
at_fn_check_prepare_trace "input.at:738"
( $at_check_trace; bison input-c.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input-c.y:1.7: warning: %code qualifier \`q' is not used
input-c.y:2.7-9: warning: %code qualifier \`bad' is not used
input-c.y:3.7-9: warning: %code qualifier \`bad' is not used
input-c.y:4.7-12: warning: %code qualifier \`format' is not used
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:738"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input-c-glr.y <<'_ATEOF'
%code q {}
%code bad {}
 %code bad {}
%%
start: ;
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/input.at:752: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot input-c-glr.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:752"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot input-c-glr.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:752"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:752: bison --xml=xml-tests/test.xml input-c-glr.y"
at_fn_check_prepare_trace "input.at:752"
( $at_check_trace; bison --xml=xml-tests/test.xml input-c-glr.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:752"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:752: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:752"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:752"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/input.at:752: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:752"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:752"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/input.at:752: bison input-c-glr.y"
at_fn_check_prepare_trace "input.at:752"
( $at_check_trace; bison input-c-glr.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input-c-glr.y:1.7: warning: %code qualifier \`q' is not used
input-c-glr.y:2.7-9: warning: %code qualifier \`bad' is not used
input-c-glr.y:3.8-10: warning: %code qualifier \`bad' is not used
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:752"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input-c++.y <<'_ATEOF'
%code q {}
%code bad {}
 %code q {}
%%
start: ;
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/input.at:765: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot input-c++.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:765"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot input-c++.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:765"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:765: bison --xml=xml-tests/test.xml input-c++.y"
at_fn_check_prepare_trace "input.at:765"
( $at_check_trace; bison --xml=xml-tests/test.xml input-c++.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:765"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:765: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:765"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:765"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/input.at:765: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:765"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:765"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/input.at:765: bison input-c++.y"
at_fn_check_prepare_trace "input.at:765"
( $at_check_trace; bison input-c++.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input-c++.y:1.7: warning: %code qualifier \`q' is not used
input-c++.y:2.7-9: warning: %code qualifier \`bad' is not used
input-c++.y:3.8: warning: %code qualifier \`q' is not used
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:765"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input-c++-glr.y <<'_ATEOF'
%code bad {}
%code q {}
%code q {}
%%
start: ;
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/input.at:778: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot input-c++-glr.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:778"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot input-c++-glr.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:778"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:778: bison --xml=xml-tests/test.xml input-c++-glr.y"
at_fn_check_prepare_trace "input.at:778"
( $at_check_trace; bison --xml=xml-tests/test.xml input-c++-glr.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:778"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:778: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:778"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:778"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/input.at:778: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:778"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:778"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/input.at:778: bison input-c++-glr.y"
at_fn_check_prepare_trace "input.at:778"
( $at_check_trace; bison input-c++-glr.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input-c++-glr.y:1.7-9: warning: %code qualifier \`bad' is not used
input-c++-glr.y:2.7: warning: %code qualifier \`q' is not used
input-c++-glr.y:3.7: warning: %code qualifier \`q' is not used
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:778"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >special-char-@@.y <<'_ATEOF'
%code bad {}
%code q {}
%code q {}
%%
start: ;
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/input.at:791: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot special-char-@@.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:791"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot special-char-@@.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:791"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:791: bison --xml=xml-tests/test.xml special-char-@@.y"
at_fn_check_prepare_trace "input.at:791"
( $at_check_trace; bison --xml=xml-tests/test.xml special-char-@@.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:791"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:791: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:791"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:791"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/input.at:791: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:791"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:791"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/input.at:791: bison special-char-@@.y"
at_fn_check_prepare_trace "input.at:791"
( $at_check_trace; bison special-char-@@.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "special-char-@@.y:1.7-9: warning: %code qualifier \`bad' is not used
special-char-@@.y:2.7: warning: %code qualifier \`q' is not used
special-char-@@.y:3.7: warning: %code qualifier \`q' is not used
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:791"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >special-char-].y <<'_ATEOF'
%code bad {}
%code q {}
%code q {}
%%
start: ;
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/input.at:804: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot special-char-].y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:804"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot special-char-].y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:804"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:804: bison --xml=xml-tests/test.xml special-char-].y"
at_fn_check_prepare_trace "input.at:804"
( $at_check_trace; bison --xml=xml-tests/test.xml special-char-].y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:804"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:804: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:804"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:804"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/input.at:804: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:804"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:804"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/input.at:804: bison special-char-].y"
at_fn_check_prepare_trace "input.at:804"
( $at_check_trace; bison special-char-].y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "special-char-].y:1.7-9: warning: %code qualifier \`bad' is not used
special-char-].y:2.7: warning: %code qualifier \`q' is not used
special-char-].y:3.7: warning: %code qualifier \`q' is not used
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:804"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_20
#AT_START_21
# 21. input.at:817: %define errors
at_setup_line='input.at:817'
at_fn_banner 1
at_desc="%define errors"
at_desc_line=" 21: $at_desc                                 "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "21. input.at:817: testing ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%define var "value1"
%define var "value1"
 %define var "value2"
%define special1 "]"
%define special2 "["
%%
start: ;
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/input.at:829: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:829"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:829"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:829: bison --xml=xml-tests/test.xml input.y"
at_fn_check_prepare_trace "input.at:829"
( $at_check_trace; bison --xml=xml-tests/test.xml input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:829"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:829: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:829"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:829"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/input.at:829: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:829"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:829"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/input.at:829: bison input.y"
at_fn_check_prepare_trace "input.at:829"
( $at_check_trace; bison input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:2.9-11: warning: %define variable \`var' redefined
input.y:1.9-11: warning: previous definition
input.y:3.10-12: warning: %define variable \`var' redefined
input.y:2.9-11: warning: previous definition
input.y:1.9-11: warning: %define variable \`var' is not used
input.y:2.9-11: warning: %define variable \`var' is not used
input.y:3.10-12: warning: %define variable \`var' is not used
input.y:4.9-16: warning: %define variable \`special1' is not used
input.y:5.9-16: warning: %define variable \`special2' is not used
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:829"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_21
#AT_START_22
# 22. input.at:847: %define Boolean variables
at_setup_line='input.at:847'
at_fn_banner 1
at_desc="%define Boolean variables"
at_desc_line=" 22: $at_desc                      "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "22. input.at:847: testing ..."
  $at_traceon


cat >Input.y <<'_ATEOF'
%language "Java"
%define public "maybe"
%define parser_class_name "Input"
%%
start: ;
_ATEOF



{ set +x
$as_echo "$at_srcdir/input.at:857: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison Input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison Input.y" "input.at:857"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison Input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "Input.y:2.9-14: invalid value for %define Boolean variable \`public'
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:857"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_22
#AT_START_23
# 23. input.at:867: %define enum variables
at_setup_line='input.at:867'
at_fn_banner 1
at_desc="%define enum variables"
at_desc_line=" 23: $at_desc                         "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "23. input.at:867: testing ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%define api.push_pull "neither"
%%
start: ;
_ATEOF



{ set +x
$as_echo "$at_srcdir/input.at:875: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:875"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:1.9-21: invalid value for %define variable \`api.push_pull': \`neither'
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:875"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_23
#AT_START_24
# 24. input.at:885: Unused %define api.pure
at_setup_line='input.at:885'
at_fn_banner 1
at_desc="Unused %define api.pure"
at_desc_line=" 24: $at_desc                        "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "24. input.at:885: testing ..."
  $at_traceon


# AT_CHECK_API_PURE(DECLS, VALUE)
# -------------------------------
# Make sure Bison reports that `%define api.pure VALUE' is unused when DECLS
# are specified.



cat >input.y <<'_ATEOF'
%define api.pure
%language "c++" %defines
%%
start: ;
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/input.at:905: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:905"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:905"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:905: bison --xml=xml-tests/test.xml input.y"
at_fn_check_prepare_trace "input.at:905"
( $at_check_trace; bison --xml=xml-tests/test.xml input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:905"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:905: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:905"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:905"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/input.at:905: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:905"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:905"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/input.at:905: bison input.y"
at_fn_check_prepare_trace "input.at:905"
( $at_check_trace; bison input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:1.9-16: warning: %define variable \`api.pure' is not used
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:905"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >input.y <<'_ATEOF'
%define api.pure "false"
%language "c++" %defines
%%
start: ;
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/input.at:906: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:906"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:906"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:906: bison --xml=xml-tests/test.xml input.y"
at_fn_check_prepare_trace "input.at:906"
( $at_check_trace; bison --xml=xml-tests/test.xml input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:906"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:906: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:906"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:906"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/input.at:906: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:906"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:906"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/input.at:906: bison input.y"
at_fn_check_prepare_trace "input.at:906"
( $at_check_trace; bison input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:1.9-16: warning: %define variable \`api.pure' is not used
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:906"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >input.y <<'_ATEOF'
%define api.pure ""
%language "c++" %defines %glr-parser
%%
start: ;
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/input.at:907: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:907"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:907"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:907: bison --xml=xml-tests/test.xml input.y"
at_fn_check_prepare_trace "input.at:907"
( $at_check_trace; bison --xml=xml-tests/test.xml input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:907"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:907: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:907"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:907"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/input.at:907: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:907"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:907"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/input.at:907: bison input.y"
at_fn_check_prepare_trace "input.at:907"
( $at_check_trace; bison input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:1.9-16: warning: %define variable \`api.pure' is not used
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:907"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >input.y <<'_ATEOF'
%define api.pure "false"
%language "c++" %defines %glr-parser
%%
start: ;
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/input.at:908: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:908"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:908"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:908: bison --xml=xml-tests/test.xml input.y"
at_fn_check_prepare_trace "input.at:908"
( $at_check_trace; bison --xml=xml-tests/test.xml input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:908"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:908: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:908"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:908"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/input.at:908: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:908"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:908"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/input.at:908: bison input.y"
at_fn_check_prepare_trace "input.at:908"
( $at_check_trace; bison input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:1.9-16: warning: %define variable \`api.pure' is not used
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:908"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >input.y <<'_ATEOF'
%define api.pure "true"
%language "java"
%%
start: ;
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/input.at:909: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:909"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:909"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:909: bison --xml=xml-tests/test.xml input.y"
at_fn_check_prepare_trace "input.at:909"
( $at_check_trace; bison --xml=xml-tests/test.xml input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:909"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:909: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:909"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:909"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/input.at:909: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:909"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:909"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/input.at:909: bison input.y"
at_fn_check_prepare_trace "input.at:909"
( $at_check_trace; bison input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:1.9-16: warning: %define variable \`api.pure' is not used
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:909"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >input.y <<'_ATEOF'
%define api.pure "false"
%language "java"
%%
start: ;
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/input.at:910: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:910"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:910"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/input.at:910: bison --xml=xml-tests/test.xml input.y"
at_fn_check_prepare_trace "input.at:910"
( $at_check_trace; bison --xml=xml-tests/test.xml input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:910"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/input.at:910: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:910"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:910"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/input.at:910: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:910"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:910"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/input.at:910: bison input.y"
at_fn_check_prepare_trace "input.at:910"
( $at_check_trace; bison input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:1.9-16: warning: %define variable \`api.pure' is not used
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:910"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_24
#AT_START_25
# 25. input.at:918: C++ namespace reference errors
at_setup_line='input.at:918'
at_fn_banner 1
at_desc="C++ namespace reference errors"
at_desc_line=" 25: $at_desc                 "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "25. input.at:918: testing ..."
  $at_traceon


# AT_CHECK_NAMESPACE_ERROR(NAMESPACE-DECL, ERROR, [ERROR], ...)
# -------------------------------------------------------------
# Make sure Bison reports all ERROR's for %define namespace "NAMESPACE-DECL".



cat >input.y <<'_ATEOF'
%language "C++"
%defines
%define namespace ""
%%
start: ;
_ATEOF



{ set +x
$as_echo "$at_srcdir/input.at:939: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:939"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:3.9-17: namespace reference is empty
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:939"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >input.y <<'_ATEOF'
%language "C++"
%defines
%define namespace " 		  	 	"
%%
start: ;
_ATEOF



{ set +x
$as_echo "$at_srcdir/input.at:941: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:941"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:3.9-17: namespace reference is empty
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:941"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >input.y <<'_ATEOF'
%language "C++"
%defines
%define namespace "foo::::bar"
%%
start: ;
_ATEOF



{ set +x
$as_echo "$at_srcdir/input.at:943: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:943"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:3.9-17: namespace reference has consecutive \"::\"
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:943"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >input.y <<'_ATEOF'
%language "C++"
%defines
%define namespace "foo:: 	::bar"
%%
start: ;
_ATEOF



{ set +x
$as_echo "$at_srcdir/input.at:945: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:945"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:3.9-17: namespace reference has consecutive \"::\"
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:945"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >input.y <<'_ATEOF'
%language "C++"
%defines
%define namespace "::::bar"
%%
start: ;
_ATEOF



{ set +x
$as_echo "$at_srcdir/input.at:947: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:947"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:3.9-17: namespace reference has consecutive \"::\"
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:947"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >input.y <<'_ATEOF'
%language "C++"
%defines
%define namespace ":: ::bar"
%%
start: ;
_ATEOF



{ set +x
$as_echo "$at_srcdir/input.at:949: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:949"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:3.9-17: namespace reference has consecutive \"::\"
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:949"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >input.y <<'_ATEOF'
%language "C++"
%defines
%define namespace "foo::bar::	::"
%%
start: ;
_ATEOF



{ set +x
$as_echo "$at_srcdir/input.at:951: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:951"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:3.9-17: namespace reference has consecutive \"::\"
input.y:3.9-17: namespace reference has a trailing \"::\"
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:951"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >input.y <<'_ATEOF'
%language "C++"
%defines
%define namespace "foo::bar::"
%%
start: ;
_ATEOF



{ set +x
$as_echo "$at_srcdir/input.at:954: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:954"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:3.9-17: namespace reference has a trailing \"::\"
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:954"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >input.y <<'_ATEOF'
%language "C++"
%defines
%define namespace "foo::bar:: 	"
%%
start: ;
_ATEOF



{ set +x
$as_echo "$at_srcdir/input.at:956: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:956"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:3.9-17: namespace reference has a trailing \"::\"
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:956"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >input.y <<'_ATEOF'
%language "C++"
%defines
%define namespace "::"
%%
start: ;
_ATEOF



{ set +x
$as_echo "$at_srcdir/input.at:958: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:958"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:3.9-17: namespace reference has a trailing \"::\"
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:958"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_25
#AT_START_26
# 26. input.at:967: Bad escapes in literals
at_setup_line='input.at:967'
at_fn_banner 1
at_desc="Bad escapes in literals"
at_desc_line=" 26: $at_desc                        "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "26. input.at:967: testing ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%%
start: '\777' '\0' '\xfff' '\x0'
       '\uffff' '\u0000' '\Uffffffff' '\U00000000'
       '\ ' '\A';
_ATEOF


# It is not easy to create special characters, we cannot even trust tr.
# Beside we cannot even expect "echo '\0'" to output two characters
# (well three with \n): at least Bash 3.2 converts the two-character
# sequence "\0" into a single NUL character.
{ set +x
$as_echo "$at_srcdir/input.at:980: perl -e 'print \"start: \\\"\\\\\\t\\\\\\f\\\\\\0\\\\\\1\\\" ;\";' >> input.y \\
           || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:980"
( $at_check_trace; perl -e 'print "start: \"\\\t\\\f\\\0\\\1\" ;";' >> input.y \
           || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:980"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/input.at:983: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "input.at:983"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:2.9-12: invalid number after \\-escape: 777
input.y:2.16-17: invalid number after \\-escape: 0
input.y:2.21-25: invalid number after \\-escape: xfff
input.y:2.29-31: invalid number after \\-escape: x0
input.y:3.9-14: invalid number after \\-escape: uffff
input.y:3.18-23: invalid number after \\-escape: u0000
input.y:3.27-36: invalid number after \\-escape: Uffffffff
input.y:3.40-49: invalid number after \\-escape: U00000000
input.y:4.9-10: invalid character after \\-escape: \` '
input.y:4.14-15: invalid character after \\-escape: A
input.y:5.9-16: invalid character after \\-escape: \\t
input.y:5.17: invalid character after \\-escape: \\f
input.y:5.18: invalid character after \\-escape: \\0
input.y:5.19: invalid character after \\-escape: \\001
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:983"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_26
#AT_START_27
# 27. output.at:42: Output files:  -dv
at_setup_line='output.at:42'
at_fn_banner 2
at_desc="Output files:  -dv "
at_desc_line=" 27: $at_desc                            "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "27. output.at:42: testing ..."
  $at_traceon

for file in foo.y foo.output foo.tab.c foo.tab.h; do
  case "$file" in
    */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
  esac
done
cat >foo.y <<'_ATEOF'

%%
foo: {};
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/output.at:42: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -dv foo.y "
at_fn_check_prepare_notrace 'an embedded newline' "output.at:42"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -dv foo.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:42"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:42: bison --xml=xml-tests/test.xml -dv foo.y "
at_fn_check_prepare_trace "output.at:42"
( $at_check_trace; bison --xml=xml-tests/test.xml -dv foo.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:42"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:42: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:42"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:42"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/output.at:42: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:42"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:42"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/output.at:42: bison -dv foo.y "
at_fn_check_prepare_trace "output.at:42"
( $at_check_trace; bison -dv foo.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:42"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:42: ls foo.output foo.tab.c foo.tab.h"
at_fn_check_prepare_trace "output.at:42"
( $at_check_trace; ls foo.output foo.tab.c foo.tab.h
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:42"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_27
#AT_START_28
# 28. output.at:44: Output files:  -dv >&-
at_setup_line='output.at:44'
at_fn_banner 2
at_desc="Output files:  -dv >&-"
at_desc_line=" 28: $at_desc                         "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "28. output.at:44: testing ..."
  $at_traceon

for file in foo.y foo.output foo.tab.c foo.tab.h; do
  case "$file" in
    */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
  esac
done
cat >foo.y <<'_ATEOF'

%%
foo: {};
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/output.at:44: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -dv foo.y >&-"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:44"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -dv foo.y >&-
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:44"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:44: bison --xml=xml-tests/test.xml -dv foo.y >&-"
at_fn_check_prepare_trace "output.at:44"
( $at_check_trace; bison --xml=xml-tests/test.xml -dv foo.y >&-
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:44"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:44: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:44"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:44"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/output.at:44: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:44"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:44"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/output.at:44: bison -dv foo.y >&-"
at_fn_check_prepare_trace "output.at:44"
( $at_check_trace; bison -dv foo.y >&-
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:44"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:44: ls foo.output foo.tab.c foo.tab.h"
at_fn_check_prepare_trace "output.at:44"
( $at_check_trace; ls foo.output foo.tab.c foo.tab.h
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:44"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_28
#AT_START_29
# 29. output.at:47: Output files:  -dv -o foo.c
at_setup_line='output.at:47'
at_fn_banner 2
at_desc="Output files:  -dv -o foo.c "
at_desc_line=" 29: $at_desc                   "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "29. output.at:47: testing ..."
  $at_traceon

for file in foo.y foo.c foo.h foo.output; do
  case "$file" in
    */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
  esac
done
cat >foo.y <<'_ATEOF'

%%
foo: {};
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/output.at:47: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -dv -o foo.c foo.y "
at_fn_check_prepare_notrace 'an embedded newline' "output.at:47"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -dv -o foo.c foo.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:47"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:47: bison --xml=xml-tests/test.xml -dv -o foo.c foo.y "
at_fn_check_prepare_trace "output.at:47"
( $at_check_trace; bison --xml=xml-tests/test.xml -dv -o foo.c foo.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:47"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:47: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:47"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:47"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/output.at:47: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:47"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:47"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/output.at:47: bison -dv -o foo.c foo.y "
at_fn_check_prepare_trace "output.at:47"
( $at_check_trace; bison -dv -o foo.c foo.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:47"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:47: ls foo.c foo.h foo.output"
at_fn_check_prepare_trace "output.at:47"
( $at_check_trace; ls foo.c foo.h foo.output
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:47"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_29
#AT_START_30
# 30. output.at:49: Output files:  -dv -o foo.tab.c
at_setup_line='output.at:49'
at_fn_banner 2
at_desc="Output files:  -dv -o foo.tab.c "
at_desc_line=" 30: $at_desc               "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "30. output.at:49: testing ..."
  $at_traceon

for file in foo.y foo.output foo.tab.c foo.tab.h; do
  case "$file" in
    */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
  esac
done
cat >foo.y <<'_ATEOF'

%%
foo: {};
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/output.at:49: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -dv -o foo.tab.c foo.y "
at_fn_check_prepare_notrace 'an embedded newline' "output.at:49"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -dv -o foo.tab.c foo.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:49"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:49: bison --xml=xml-tests/test.xml -dv -o foo.tab.c foo.y "
at_fn_check_prepare_trace "output.at:49"
( $at_check_trace; bison --xml=xml-tests/test.xml -dv -o foo.tab.c foo.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:49"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:49: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:49"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:49"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/output.at:49: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:49"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:49"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/output.at:49: bison -dv -o foo.tab.c foo.y "
at_fn_check_prepare_trace "output.at:49"
( $at_check_trace; bison -dv -o foo.tab.c foo.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:49"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:49: ls foo.output foo.tab.c foo.tab.h"
at_fn_check_prepare_trace "output.at:49"
( $at_check_trace; ls foo.output foo.tab.c foo.tab.h
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:49"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_30
#AT_START_31
# 31. output.at:51: Output files:  -dv -y
at_setup_line='output.at:51'
at_fn_banner 2
at_desc="Output files:  -dv -y "
at_desc_line=" 31: $at_desc                         "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "31. output.at:51: testing ..."
  $at_traceon

for file in foo.y y.output y.tab.c y.tab.h; do
  case "$file" in
    */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
  esac
done
cat >foo.y <<'_ATEOF'

%%
foo: {};
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/output.at:51: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -dv -y foo.y "
at_fn_check_prepare_notrace 'an embedded newline' "output.at:51"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -dv -y foo.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:51"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:51: bison --xml=xml-tests/test.xml -dv -y foo.y "
at_fn_check_prepare_trace "output.at:51"
( $at_check_trace; bison --xml=xml-tests/test.xml -dv -y foo.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:51"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:51: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:51"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:51"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/output.at:51: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:51"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:51"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/output.at:51: bison -dv -y foo.y "
at_fn_check_prepare_trace "output.at:51"
( $at_check_trace; bison -dv -y foo.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:51"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:51: ls y.output y.tab.c y.tab.h"
at_fn_check_prepare_trace "output.at:51"
( $at_check_trace; ls y.output y.tab.c y.tab.h
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:51"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_31
#AT_START_32
# 32. output.at:53: Output files:  -dv -b bar
at_setup_line='output.at:53'
at_fn_banner 2
at_desc="Output files:  -dv -b bar "
at_desc_line=" 32: $at_desc                     "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "32. output.at:53: testing ..."
  $at_traceon

for file in foo.y bar.output bar.tab.c bar.tab.h; do
  case "$file" in
    */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
  esac
done
cat >foo.y <<'_ATEOF'

%%
foo: {};
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/output.at:53: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -dv -b bar foo.y "
at_fn_check_prepare_notrace 'an embedded newline' "output.at:53"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -dv -b bar foo.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:53"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:53: bison --xml=xml-tests/test.xml -dv -b bar foo.y "
at_fn_check_prepare_trace "output.at:53"
( $at_check_trace; bison --xml=xml-tests/test.xml -dv -b bar foo.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:53"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:53: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:53"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:53"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/output.at:53: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:53"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:53"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/output.at:53: bison -dv -b bar foo.y "
at_fn_check_prepare_trace "output.at:53"
( $at_check_trace; bison -dv -b bar foo.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:53"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:53: ls bar.output bar.tab.c bar.tab.h"
at_fn_check_prepare_trace "output.at:53"
( $at_check_trace; ls bar.output bar.tab.c bar.tab.h
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:53"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_32
#AT_START_33
# 33. output.at:55: Output files:  -dv -g -o foo.c
at_setup_line='output.at:55'
at_fn_banner 2
at_desc="Output files:  -dv -g -o foo.c "
at_desc_line=" 33: $at_desc                "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "33. output.at:55: testing ..."
  $at_traceon

for file in foo.y foo.c foo.dot foo.h foo.output; do
  case "$file" in
    */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
  esac
done
cat >foo.y <<'_ATEOF'

%%
foo: {};
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/output.at:55: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -dv -g -o foo.c foo.y "
at_fn_check_prepare_notrace 'an embedded newline' "output.at:55"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -dv -g -o foo.c foo.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:55"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:55: bison --xml=xml-tests/test.xml -dv -g -o foo.c foo.y "
at_fn_check_prepare_trace "output.at:55"
( $at_check_trace; bison --xml=xml-tests/test.xml -dv -g -o foo.c foo.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:55"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:55: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:55"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:55"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/output.at:55: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:55"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:55"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/output.at:55: bison -dv -g -o foo.c foo.y "
at_fn_check_prepare_trace "output.at:55"
( $at_check_trace; bison -dv -g -o foo.c foo.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:55"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:55: ls foo.c foo.dot foo.h foo.output"
at_fn_check_prepare_trace "output.at:55"
( $at_check_trace; ls foo.c foo.dot foo.h foo.output
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:55"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_33
#AT_START_34
# 34. output.at:59: Output files: %defines %verbose
at_setup_line='output.at:59'
at_fn_banner 2
at_desc="Output files: %defines %verbose  "
at_desc_line=" 34: $at_desc              "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "34. output.at:59: testing ..."
  $at_traceon

for file in foo.y foo.output foo.tab.c foo.tab.h; do
  case "$file" in
    */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
  esac
done
cat >foo.y <<'_ATEOF'
%defines %verbose
%%
foo: {};
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/output.at:59: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot  foo.y "
at_fn_check_prepare_notrace 'an embedded newline' "output.at:59"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot  foo.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:59"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:59: bison --xml=xml-tests/test.xml  foo.y "
at_fn_check_prepare_trace "output.at:59"
( $at_check_trace; bison --xml=xml-tests/test.xml  foo.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:59"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:59: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:59"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:59"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/output.at:59: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:59"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:59"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/output.at:59: bison  foo.y "
at_fn_check_prepare_trace "output.at:59"
( $at_check_trace; bison  foo.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:59"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:59: ls foo.output foo.tab.c foo.tab.h"
at_fn_check_prepare_trace "output.at:59"
( $at_check_trace; ls foo.output foo.tab.c foo.tab.h
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:59"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_34
#AT_START_35
# 35. output.at:61: Output files: %defines %verbose %yacc
at_setup_line='output.at:61'
at_fn_banner 2
at_desc="Output files: %defines %verbose %yacc  "
at_desc_line=" 35: $at_desc        "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "35. output.at:61: testing ..."
  $at_traceon

for file in foo.y y.output y.tab.c y.tab.h; do
  case "$file" in
    */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
  esac
done
cat >foo.y <<'_ATEOF'
%defines %verbose %yacc
%%
foo: {};
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/output.at:61: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot  foo.y "
at_fn_check_prepare_notrace 'an embedded newline' "output.at:61"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot  foo.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:61"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:61: bison --xml=xml-tests/test.xml  foo.y "
at_fn_check_prepare_trace "output.at:61"
( $at_check_trace; bison --xml=xml-tests/test.xml  foo.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:61"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:61: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:61"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:61"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/output.at:61: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:61"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:61"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/output.at:61: bison  foo.y "
at_fn_check_prepare_trace "output.at:61"
( $at_check_trace; bison  foo.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:61"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:61: ls y.output y.tab.c y.tab.h"
at_fn_check_prepare_trace "output.at:61"
( $at_check_trace; ls y.output y.tab.c y.tab.h
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:61"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_35
#AT_START_36
# 36. output.at:64: Output files: %defines %verbose %yacc
at_setup_line='output.at:64'
at_fn_banner 2
at_desc="Output files: %defines %verbose %yacc  "
at_desc_line=" 36: $at_desc        "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "36. output.at:64: testing ..."
  $at_traceon

for file in foo.yy y.output y.tab.c y.tab.h; do
  case "$file" in
    */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
  esac
done
cat >foo.yy <<'_ATEOF'
%defines %verbose %yacc
%%
foo: {};
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/output.at:64: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot  foo.yy "
at_fn_check_prepare_notrace 'an embedded newline' "output.at:64"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot  foo.yy
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:64"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:64: bison --xml=xml-tests/test.xml  foo.yy "
at_fn_check_prepare_trace "output.at:64"
( $at_check_trace; bison --xml=xml-tests/test.xml  foo.yy
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:64"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:64: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:64"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:64"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/output.at:64: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:64"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:64"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/output.at:64: bison  foo.yy "
at_fn_check_prepare_trace "output.at:64"
( $at_check_trace; bison  foo.yy
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:64"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:64: ls y.output y.tab.c y.tab.h"
at_fn_check_prepare_trace "output.at:64"
( $at_check_trace; ls y.output y.tab.c y.tab.h
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:64"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_36
#AT_START_37
# 37. output.at:68: Output files: %file-prefix "bar" %defines %verbose
at_setup_line='output.at:68'
at_fn_banner 2
at_desc="Output files: %file-prefix \"bar\" %defines %verbose  "
at_desc_line=" 37: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "37. output.at:68: testing ..."
  $at_traceon

for file in foo.y bar.output bar.tab.c bar.tab.h; do
  case "$file" in
    */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
  esac
done
cat >foo.y <<'_ATEOF'
%file-prefix "bar" %defines %verbose
%%
foo: {};
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/output.at:68: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot  foo.y "
at_fn_check_prepare_notrace 'an embedded newline' "output.at:68"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot  foo.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:68"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:68: bison --xml=xml-tests/test.xml  foo.y "
at_fn_check_prepare_trace "output.at:68"
( $at_check_trace; bison --xml=xml-tests/test.xml  foo.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:68"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:68: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:68"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:68"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/output.at:68: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:68"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:68"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/output.at:68: bison  foo.y "
at_fn_check_prepare_trace "output.at:68"
( $at_check_trace; bison  foo.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:68"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:68: ls bar.output bar.tab.c bar.tab.h"
at_fn_check_prepare_trace "output.at:68"
( $at_check_trace; ls bar.output bar.tab.c bar.tab.h
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:68"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_37
#AT_START_38
# 38. output.at:70: Output files: %output="bar.c" %defines %verbose %yacc
at_setup_line='output.at:70'
at_fn_banner 2
at_desc="Output files: %output=\"bar.c\" %defines %verbose %yacc  "
at_desc_line=" 38: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "38. output.at:70: testing ..."
  $at_traceon

for file in foo.y bar.output bar.c bar.h; do
  case "$file" in
    */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
  esac
done
cat >foo.y <<'_ATEOF'
%output="bar.c" %defines %verbose %yacc
%%
foo: {};
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/output.at:70: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot  foo.y "
at_fn_check_prepare_notrace 'an embedded newline' "output.at:70"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot  foo.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:70"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:70: bison --xml=xml-tests/test.xml  foo.y "
at_fn_check_prepare_trace "output.at:70"
( $at_check_trace; bison --xml=xml-tests/test.xml  foo.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:70"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:70: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:70"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:70"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/output.at:70: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:70"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:70"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/output.at:70: bison  foo.y "
at_fn_check_prepare_trace "output.at:70"
( $at_check_trace; bison  foo.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:70"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:70: ls bar.output bar.c bar.h"
at_fn_check_prepare_trace "output.at:70"
( $at_check_trace; ls bar.output bar.c bar.h
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:70"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_38
#AT_START_39
# 39. output.at:72: Output files: %file-prefix="baz" %output "bar.c" %defines %verbose %yacc
at_setup_line='output.at:72'
at_fn_banner 2
at_desc="Output files: %file-prefix=\"baz\" %output \"bar.c\" %defines %verbose %yacc  "
at_desc_line=" 39: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "39. output.at:72: testing ..."
  $at_traceon

for file in foo.y bar.output bar.c bar.h; do
  case "$file" in
    */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
  esac
done
cat >foo.y <<'_ATEOF'
%file-prefix="baz" %output "bar.c" %defines %verbose %yacc
%%
foo: {};
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/output.at:72: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot  foo.y "
at_fn_check_prepare_notrace 'an embedded newline' "output.at:72"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot  foo.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:72"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:72: bison --xml=xml-tests/test.xml  foo.y "
at_fn_check_prepare_trace "output.at:72"
( $at_check_trace; bison --xml=xml-tests/test.xml  foo.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:72"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:72: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:72"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:72"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/output.at:72: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:72"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:72"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/output.at:72: bison  foo.y "
at_fn_check_prepare_trace "output.at:72"
( $at_check_trace; bison  foo.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:72"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:72: ls bar.output bar.c bar.h"
at_fn_check_prepare_trace "output.at:72"
( $at_check_trace; ls bar.output bar.c bar.h
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:72"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_39
#AT_START_40
# 40. output.at:79: Output files: %defines %verbose
at_setup_line='output.at:79'
at_fn_banner 2
at_desc="Output files: %defines %verbose  "
at_desc_line=" 40: $at_desc              "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "40. output.at:79: testing ..."
  $at_traceon

for file in foo.yy foo.output foo.tab.cc foo.tab.hh; do
  case "$file" in
    */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
  esac
done
cat >foo.yy <<'_ATEOF'
%defines %verbose
%%
foo: {};
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/output.at:79: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot  foo.yy "
at_fn_check_prepare_notrace 'an embedded newline' "output.at:79"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot  foo.yy
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:79: bison --xml=xml-tests/test.xml  foo.yy "
at_fn_check_prepare_trace "output.at:79"
( $at_check_trace; bison --xml=xml-tests/test.xml  foo.yy
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:79: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:79"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/output.at:79: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:79"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/output.at:79: bison  foo.yy "
at_fn_check_prepare_trace "output.at:79"
( $at_check_trace; bison  foo.yy
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:79: ls foo.output foo.tab.cc foo.tab.hh"
at_fn_check_prepare_trace "output.at:79"
( $at_check_trace; ls foo.output foo.tab.cc foo.tab.hh
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_40
#AT_START_41
# 41. output.at:82: Output files: %defines %verbose  -o foo.c
at_setup_line='output.at:82'
at_fn_banner 2
at_desc="Output files: %defines %verbose  -o foo.c "
at_desc_line=" 41: $at_desc     "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "41. output.at:82: testing ..."
  $at_traceon

for file in foo.yy foo.c foo.h foo.output; do
  case "$file" in
    */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
  esac
done
cat >foo.yy <<'_ATEOF'
%defines %verbose
%%
foo: {};
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/output.at:82: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o foo.c foo.yy "
at_fn_check_prepare_notrace 'an embedded newline' "output.at:82"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o foo.c foo.yy
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:82"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:82: bison --xml=xml-tests/test.xml -o foo.c foo.yy "
at_fn_check_prepare_trace "output.at:82"
( $at_check_trace; bison --xml=xml-tests/test.xml -o foo.c foo.yy
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:82"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:82: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:82"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:82"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/output.at:82: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:82"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:82"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/output.at:82: bison -o foo.c foo.yy "
at_fn_check_prepare_trace "output.at:82"
( $at_check_trace; bison -o foo.c foo.yy
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:82"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:82: ls foo.c foo.h foo.output"
at_fn_check_prepare_trace "output.at:82"
( $at_check_trace; ls foo.c foo.h foo.output
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:82"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_41
#AT_START_42
# 42. output.at:85: Output files:  --defines=foo.hpp -o foo.c++
at_setup_line='output.at:85'
at_fn_banner 2
at_desc="Output files:  --defines=foo.hpp -o foo.c++ "
at_desc_line=" 42: $at_desc   "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "42. output.at:85: testing ..."
  $at_traceon

for file in foo.yy foo.c++ foo.hpp; do
  case "$file" in
    */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
  esac
done
cat >foo.yy <<'_ATEOF'

%%
foo: {};
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/output.at:85: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot --defines=foo.hpp -o foo.c++ foo.yy "
at_fn_check_prepare_notrace 'an embedded newline' "output.at:85"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot --defines=foo.hpp -o foo.c++ foo.yy
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:85"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:85: bison --xml=xml-tests/test.xml --defines=foo.hpp -o foo.c++ foo.yy "
at_fn_check_prepare_trace "output.at:85"
( $at_check_trace; bison --xml=xml-tests/test.xml --defines=foo.hpp -o foo.c++ foo.yy
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:85"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:85: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:85"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:85"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/output.at:85: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:85"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:85"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/output.at:85: bison --defines=foo.hpp -o foo.c++ foo.yy "
at_fn_check_prepare_trace "output.at:85"
( $at_check_trace; bison --defines=foo.hpp -o foo.c++ foo.yy
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:85"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:85: ls foo.c++ foo.hpp"
at_fn_check_prepare_trace "output.at:85"
( $at_check_trace; ls foo.c++ foo.hpp
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:85"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_42
#AT_START_43
# 43. output.at:89: Output files: %defines "foo.hpp" -o foo.c++
at_setup_line='output.at:89'
at_fn_banner 2
at_desc="Output files: %defines \"foo.hpp\" -o foo.c++ "
at_desc_line=" 43: $at_desc   "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "43. output.at:89: testing ..."
  $at_traceon

for file in foo.yy foo.c++ foo.hpp; do
  case "$file" in
    */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
  esac
done
cat >foo.yy <<'_ATEOF'
%defines "foo.hpp"
%%
foo: {};
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/output.at:89: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o foo.c++ foo.yy "
at_fn_check_prepare_notrace 'an embedded newline' "output.at:89"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o foo.c++ foo.yy
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:89"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:89: bison --xml=xml-tests/test.xml -o foo.c++ foo.yy "
at_fn_check_prepare_trace "output.at:89"
( $at_check_trace; bison --xml=xml-tests/test.xml -o foo.c++ foo.yy
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:89"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:89: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:89"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:89"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/output.at:89: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:89"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:89"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/output.at:89: bison -o foo.c++ foo.yy "
at_fn_check_prepare_trace "output.at:89"
( $at_check_trace; bison -o foo.c++ foo.yy
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:89"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:89: ls foo.c++ foo.hpp"
at_fn_check_prepare_trace "output.at:89"
( $at_check_trace; ls foo.c++ foo.hpp
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:89"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_43
#AT_START_44
# 44. output.at:93: Output files:  -o foo.c++ --graph=foo.gph
at_setup_line='output.at:93'
at_fn_banner 2
at_desc="Output files:  -o foo.c++ --graph=foo.gph "
at_desc_line=" 44: $at_desc     "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "44. output.at:93: testing ..."
  $at_traceon

for file in foo.yy foo.c++ foo.gph; do
  case "$file" in
    */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
  esac
done
cat >foo.yy <<'_ATEOF'

%%
foo: {};
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/output.at:93: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o foo.c++  foo.yy "
at_fn_check_prepare_notrace 'an embedded newline' "output.at:93"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o foo.c++  foo.yy
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:93"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:93: bison --xml=xml-tests/test.xml -o foo.c++  foo.yy "
at_fn_check_prepare_trace "output.at:93"
( $at_check_trace; bison --xml=xml-tests/test.xml -o foo.c++  foo.yy
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:93"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:93: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:93"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:93"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/output.at:93: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:93"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:93"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/output.at:93: bison -o foo.c++ --graph=foo.gph foo.yy "
at_fn_check_prepare_trace "output.at:93"
( $at_check_trace; bison -o foo.c++ --graph=foo.gph foo.yy
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:93"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:93: ls foo.c++ foo.gph"
at_fn_check_prepare_trace "output.at:93"
( $at_check_trace; ls foo.c++ foo.gph
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:93"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_44
#AT_START_45
# 45. output.at:108: Output files: %skeleton "lalr1.cc" %defines %verbose
at_setup_line='output.at:108'
at_fn_banner 2
at_desc="Output files: %skeleton \"lalr1.cc\" %defines %verbose  "
at_desc_line=" 45: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "45. output.at:108: testing ..."
  $at_traceon

for file in foo.yy foo.tab.cc foo.tab.hh foo.output location.hh stack.hh position.hh; do
  case "$file" in
    */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
  esac
done
cat >foo.yy <<'_ATEOF'
%skeleton "lalr1.cc" %defines %verbose
%%
foo: {};
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/output.at:108: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot  foo.yy "
at_fn_check_prepare_notrace 'an embedded newline' "output.at:108"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot  foo.yy
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:108"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:108: bison --xml=xml-tests/test.xml  foo.yy "
at_fn_check_prepare_trace "output.at:108"
( $at_check_trace; bison --xml=xml-tests/test.xml  foo.yy
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:108"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:108: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:108"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:108"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/output.at:108: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:108"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:108"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/output.at:108: bison  foo.yy "
at_fn_check_prepare_trace "output.at:108"
( $at_check_trace; bison  foo.yy
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:108"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:108: ls foo.tab.cc foo.tab.hh foo.output location.hh stack.hh position.hh"
at_fn_check_prepare_trace "output.at:108"
( $at_check_trace; ls foo.tab.cc foo.tab.hh foo.output location.hh stack.hh position.hh
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:108"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_45
#AT_START_46
# 46. output.at:111: Output files: %skeleton "lalr1.cc" %defines %verbose
at_setup_line='output.at:111'
at_fn_banner 2
at_desc="Output files: %skeleton \"lalr1.cc\" %defines %verbose  "
at_desc_line=" 46: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "46. output.at:111: testing ..."
  $at_traceon

for file in subdir/foo.yy foo.tab.cc foo.tab.hh foo.output location.hh stack.hh position.hh; do
  case "$file" in
    */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
  esac
done
cat >subdir/foo.yy <<'_ATEOF'
%skeleton "lalr1.cc" %defines %verbose
%%
foo: {};
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/output.at:111: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot  subdir/foo.yy "
at_fn_check_prepare_notrace 'an embedded newline' "output.at:111"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot  subdir/foo.yy
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:111"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:111: bison --xml=xml-tests/test.xml  subdir/foo.yy "
at_fn_check_prepare_trace "output.at:111"
( $at_check_trace; bison --xml=xml-tests/test.xml  subdir/foo.yy
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:111"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:111: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:111"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:111"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/output.at:111: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:111"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:111"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/output.at:111: bison  subdir/foo.yy "
at_fn_check_prepare_trace "output.at:111"
( $at_check_trace; bison  subdir/foo.yy
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:111"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:111: ls foo.tab.cc foo.tab.hh foo.output location.hh stack.hh position.hh"
at_fn_check_prepare_trace "output.at:111"
( $at_check_trace; ls foo.tab.cc foo.tab.hh foo.output location.hh stack.hh position.hh
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:111"
$at_failed && at_fn_log_failure
$at_traceon; }

# Also make sure that the includes do not refer to the subdirectory.
{ set +x
$as_echo "$at_srcdir/output.at:111: grep 'include .subdir/' foo.tab.cc"
at_fn_check_prepare_trace "output.at:111"
( $at_check_trace; grep 'include .subdir/' foo.tab.cc
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/output.at:111"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:111: grep 'include .subdir/' foo.tab.hh"
at_fn_check_prepare_trace "output.at:111"
( $at_check_trace; grep 'include .subdir/' foo.tab.hh
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/output.at:111"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_46
#AT_START_47
# 47. output.at:115: Output files: %skeleton "lalr1.cc" %defines %verbose -o subdir/foo.cc
at_setup_line='output.at:115'
at_fn_banner 2
at_desc="Output files: %skeleton \"lalr1.cc\" %defines %verbose -o subdir/foo.cc "
at_desc_line=" 47: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "47. output.at:115: testing ..."
  $at_traceon

for file in subdir/foo.yy subdir/foo.cc subdir/foo.hh subdir/foo.output subdir/location.hh subdir/stack.hh subdir/position.hh; do
  case "$file" in
    */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
  esac
done
cat >subdir/foo.yy <<'_ATEOF'
%skeleton "lalr1.cc" %defines %verbose
%%
foo: {};
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/output.at:115: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o subdir/foo.cc subdir/foo.yy "
at_fn_check_prepare_notrace 'an embedded newline' "output.at:115"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o subdir/foo.cc subdir/foo.yy
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:115"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:115: bison --xml=xml-tests/test.xml -o subdir/foo.cc subdir/foo.yy "
at_fn_check_prepare_trace "output.at:115"
( $at_check_trace; bison --xml=xml-tests/test.xml -o subdir/foo.cc subdir/foo.yy
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:115"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:115: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:115"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:115"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/output.at:115: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:115"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:115"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/output.at:115: bison -o subdir/foo.cc subdir/foo.yy "
at_fn_check_prepare_trace "output.at:115"
( $at_check_trace; bison -o subdir/foo.cc subdir/foo.yy
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:115"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:115: ls subdir/foo.cc subdir/foo.hh subdir/foo.output subdir/location.hh subdir/stack.hh subdir/position.hh"
at_fn_check_prepare_trace "output.at:115"
( $at_check_trace; ls subdir/foo.cc subdir/foo.hh subdir/foo.output subdir/location.hh subdir/stack.hh subdir/position.hh
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:115"
$at_failed && at_fn_log_failure
$at_traceon; }

# Also make sure that the includes do not refer to the subdirectory.
{ set +x
$as_echo "$at_srcdir/output.at:115: grep 'include .subdir/' subdir/foo.cc"
at_fn_check_prepare_trace "output.at:115"
( $at_check_trace; grep 'include .subdir/' subdir/foo.cc
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/output.at:115"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:115: grep 'include .subdir/' subdir/foo.hh"
at_fn_check_prepare_trace "output.at:115"
( $at_check_trace; grep 'include .subdir/' subdir/foo.hh
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/output.at:115"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_47
#AT_START_48
# 48. output.at:120: Output files: %skeleton "lalr1.cc" %defines %verbose %file-prefix "output_dir/foo"
at_setup_line='output.at:120'
at_fn_banner 2
at_desc="Output files: %skeleton \"lalr1.cc\" %defines %verbose %file-prefix \"output_dir/foo\"  "
at_desc_line=" 48: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "48. output.at:120: testing ..."
  $at_traceon

for file in gram_dir/foo.yy output_dir/foo.tab.cc output_dir/foo.tab.hh output_dir/foo.output output_dir/location.hh output_dir/stack.hh output_dir/position.hh; do
  case "$file" in
    */*) mkdir -p `echo "$file" | sed 's,/.*,,'`;;
  esac
done
cat >gram_dir/foo.yy <<'_ATEOF'
%skeleton "lalr1.cc" %defines %verbose %file-prefix "output_dir/foo"
%%
foo: {};
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/output.at:120: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot  gram_dir/foo.yy "
at_fn_check_prepare_notrace 'an embedded newline' "output.at:120"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot  gram_dir/foo.yy
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:120"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:120: bison --xml=xml-tests/test.xml  gram_dir/foo.yy "
at_fn_check_prepare_trace "output.at:120"
( $at_check_trace; bison --xml=xml-tests/test.xml  gram_dir/foo.yy
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:120"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:120: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:120"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:120"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/output.at:120: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:120"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:120"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/output.at:120: bison  gram_dir/foo.yy "
at_fn_check_prepare_trace "output.at:120"
( $at_check_trace; bison  gram_dir/foo.yy
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:120"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:120: ls output_dir/foo.tab.cc output_dir/foo.tab.hh output_dir/foo.output output_dir/location.hh output_dir/stack.hh output_dir/position.hh"
at_fn_check_prepare_trace "output.at:120"
( $at_check_trace; ls output_dir/foo.tab.cc output_dir/foo.tab.hh output_dir/foo.output output_dir/location.hh output_dir/stack.hh output_dir/position.hh
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:120"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_48
#AT_START_49
# 49. output.at:150: Conflicting output files:  --graph="foo.tab.c"
at_setup_line='output.at:150'
at_fn_banner 2
at_desc="Conflicting output files:  --graph=\"foo.tab.c\""
at_desc_line=" 49: $at_desc "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "49. output.at:150: testing ..."
  $at_traceon

case "foo.y" in
  */*) mkdir `echo "foo.y" | sed 's,/.*,,'`;;
esac
cat >foo.y <<'_ATEOF'

%%
foo: {};
_ATEOF


cp foo.y expout
# Because an output file name conflict is still a warning, Bison exits
# with status 0, so AT_BISON_CHECK does not realize that there may be no
# output file against which to check the XML.  AT_BISON_CHECK_NO_XML
# avoids that problem.
{ set +x
$as_echo "$at_srcdir/output.at:150: bison --graph=\"foo.tab.c\" foo.y"
at_fn_check_prepare_trace "output.at:150"
( $at_check_trace; bison --graph="foo.tab.c" foo.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "foo.y: warning: conflicting outputs to file \`foo.tab.c'
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:150"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:150: cat foo.y"
at_fn_check_prepare_trace "output.at:150"
( $at_check_trace; cat foo.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:150"
$at_failed && at_fn_log_failure
$at_traceon; }

  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_49
#AT_START_50
# 50. output.at:155: Conflicting output files: %defines "foo.output" -v
at_setup_line='output.at:155'
at_fn_banner 2
at_desc="Conflicting output files: %defines \"foo.output\" -v"
at_desc_line=" 50: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "50. output.at:155: testing ..."
  $at_traceon

case "foo.y" in
  */*) mkdir `echo "foo.y" | sed 's,/.*,,'`;;
esac
cat >foo.y <<'_ATEOF'
%defines "foo.output"
%%
foo: {};
_ATEOF


cp foo.y expout
# Because an output file name conflict is still a warning, Bison exits
# with status 0, so AT_BISON_CHECK does not realize that there may be no
# output file against which to check the XML.  AT_BISON_CHECK_NO_XML
# avoids that problem.
{ set +x
$as_echo "$at_srcdir/output.at:155: bison -v foo.y"
at_fn_check_prepare_trace "output.at:155"
( $at_check_trace; bison -v foo.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "foo.y: warning: conflicting outputs to file \`foo.output'
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:155"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:155: cat foo.y"
at_fn_check_prepare_trace "output.at:155"
( $at_check_trace; cat foo.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:155"
$at_failed && at_fn_log_failure
$at_traceon; }

  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_50
#AT_START_51
# 51. output.at:160: Conflicting output files: %skeleton "lalr1.cc" %defines --graph="location.hh"
at_setup_line='output.at:160'
at_fn_banner 2
at_desc="Conflicting output files: %skeleton \"lalr1.cc\" %defines --graph=\"location.hh\""
at_desc_line=" 51: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "51. output.at:160: testing ..."
  $at_traceon

case "foo.y" in
  */*) mkdir `echo "foo.y" | sed 's,/.*,,'`;;
esac
cat >foo.y <<'_ATEOF'
%skeleton "lalr1.cc" %defines
%%
foo: {};
_ATEOF


cp foo.y expout
# Because an output file name conflict is still a warning, Bison exits
# with status 0, so AT_BISON_CHECK does not realize that there may be no
# output file against which to check the XML.  AT_BISON_CHECK_NO_XML
# avoids that problem.
{ set +x
$as_echo "$at_srcdir/output.at:160: bison --graph=\"location.hh\" foo.y"
at_fn_check_prepare_trace "output.at:160"
( $at_check_trace; bison --graph="location.hh" foo.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "foo.y: warning: conflicting outputs to file \`location.hh'
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:160"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:160: cat foo.y"
at_fn_check_prepare_trace "output.at:160"
( $at_check_trace; cat foo.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:160"
$at_failed && at_fn_log_failure
$at_traceon; }

  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_51
#AT_START_52
# 52. output.at:165: Conflicting output files:  -o foo.y
at_setup_line='output.at:165'
at_fn_banner 2
at_desc="Conflicting output files:  -o foo.y"
at_desc_line=" 52: $at_desc            "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "52. output.at:165: testing ..."
  $at_traceon

case "foo.y" in
  */*) mkdir `echo "foo.y" | sed 's,/.*,,'`;;
esac
cat >foo.y <<'_ATEOF'

%%
foo: {};
_ATEOF


cp foo.y expout
# Because an output file name conflict is still a warning, Bison exits
# with status 0, so AT_BISON_CHECK does not realize that there may be no
# output file against which to check the XML.  AT_BISON_CHECK_NO_XML
# avoids that problem.
{ set +x
$as_echo "$at_srcdir/output.at:165: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o foo.y foo.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o foo.y foo.y" "output.at:165"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o foo.y foo.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "foo.y: refusing to overwrite the input file \`foo.y'
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/output.at:165"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:165: cat foo.y"
at_fn_check_prepare_trace "output.at:165"
( $at_check_trace; cat foo.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:165"
$at_failed && at_fn_log_failure
$at_traceon; }

  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_52
#AT_START_53
# 53. output.at:209: Output file name: `~!@#$%^&*()-=_+{}[]|\:;<>, .'
at_setup_line='output.at:209'
at_fn_banner 2
at_desc="Output file name: \`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'"
at_desc_line=" 53: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "53. output.at:209: testing ..."
  $at_traceon


# Skip if platform doesn't support file name.  For example, Cygwin
# doesn't support file names containing ":" or "\".
{ set +x
$as_echo "$at_srcdir/output.at:209: touch \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.tmp\" || exit 77"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:209"
( $at_check_trace; touch "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.tmp" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:209"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >glr.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%glr-parser
%code {
  int yylex (void);
  void yyerror (const char *);
}
%%
start: {};
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/output.at:209: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.c\" --defines=\"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.h\" glr.y"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:209"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.c" --defines="\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.h" glr.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:209"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:209: bison --xml=xml-tests/test.xml -o \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.c\" --defines=\"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.h\" glr.y"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:209"
( $at_check_trace; bison --xml=xml-tests/test.xml -o "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.c" --defines="\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.h" glr.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:209"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:209: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:209"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:209"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/output.at:209: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:209"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:209"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/output.at:209: bison -o \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.c\" --defines=\"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.h\" glr.y"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:209"
( $at_check_trace; bison -o "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.c" --defines="\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.h" glr.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:209"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:209: ls \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.c\" \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.h\""
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:209"
( $at_check_trace; ls "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.c" "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.h"
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:209"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:209: \$CC \$CFLAGS \$CPPFLAGS -o glr.o -c \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.c\""
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:209"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -o glr.o -c "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.c"
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:209"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >cxx.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%skeleton "lalr1.cc"
%code { int yylex (yy::parser::semantic_type*); }
%%
start: {};
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/output.at:209: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.c\" --defines=\"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.h\" cxx.y"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:209"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.c" --defines="\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.h" cxx.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:209"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:209: bison --xml=xml-tests/test.xml -o \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.c\" --defines=\"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.h\" cxx.y"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:209"
( $at_check_trace; bison --xml=xml-tests/test.xml -o "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.c" --defines="\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.h" cxx.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:209"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:209: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:209"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:209"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/output.at:209: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:209"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:209"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/output.at:209: bison -o \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.c\" --defines=\"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.h\" cxx.y"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:209"
( $at_check_trace; bison -o "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.c" --defines="\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.h" cxx.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:209"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:209: ls \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.c\" \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.h\""
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:209"
( $at_check_trace; ls "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.c" "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.h"
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:209"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/output.at:209: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "output.at:209"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:209"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:209: \$CXX \$CXXFLAGS \$CPPFLAGS -o cxx.o -c \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.c\""
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:209"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -o cxx.o -c "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.c"
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:209"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_53
#AT_START_54
# 54. output.at:216: Output file name: (
at_setup_line='output.at:216'
at_fn_banner 2
at_desc="Output file name: ("
at_desc_line=" 54: $at_desc                            "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "54. output.at:216: testing ..."
  $at_traceon


# Skip if platform doesn't support file name.  For example, Cygwin
# doesn't support file names containing ":" or "\".
{ set +x
$as_echo "$at_srcdir/output.at:216: touch \"(.tmp\" || exit 77"
at_fn_check_prepare_trace "output.at:216"
( $at_check_trace; touch "(.tmp" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:216"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >glr.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%glr-parser
%code {
  int yylex (void);
  void yyerror (const char *);
}
%%
start: {};
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/output.at:216: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o \"(.c\" --defines=\"(.h\" glr.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:216"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o "(.c" --defines="(.h" glr.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:216"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:216: bison --xml=xml-tests/test.xml -o \"(.c\" --defines=\"(.h\" glr.y"
at_fn_check_prepare_trace "output.at:216"
( $at_check_trace; bison --xml=xml-tests/test.xml -o "(.c" --defines="(.h" glr.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:216"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:216: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:216"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:216"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/output.at:216: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:216"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:216"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/output.at:216: bison -o \"(.c\" --defines=\"(.h\" glr.y"
at_fn_check_prepare_trace "output.at:216"
( $at_check_trace; bison -o "(.c" --defines="(.h" glr.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:216"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:216: ls \"(.c\" \"(.h\""
at_fn_check_prepare_trace "output.at:216"
( $at_check_trace; ls "(.c" "(.h"
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:216"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:216: \$CC \$CFLAGS \$CPPFLAGS -o glr.o -c \"(.c\""
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -o glr.o -c \"(.c\"" "output.at:216"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -o glr.o -c "(.c"
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:216"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >cxx.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%skeleton "lalr1.cc"
%code { int yylex (yy::parser::semantic_type*); }
%%
start: {};
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/output.at:216: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o \"(.c\" --defines=\"(.h\" cxx.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:216"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o "(.c" --defines="(.h" cxx.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:216"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:216: bison --xml=xml-tests/test.xml -o \"(.c\" --defines=\"(.h\" cxx.y"
at_fn_check_prepare_trace "output.at:216"
( $at_check_trace; bison --xml=xml-tests/test.xml -o "(.c" --defines="(.h" cxx.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:216"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:216: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:216"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:216"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/output.at:216: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:216"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:216"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/output.at:216: bison -o \"(.c\" --defines=\"(.h\" cxx.y"
at_fn_check_prepare_trace "output.at:216"
( $at_check_trace; bison -o "(.c" --defines="(.h" cxx.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:216"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:216: ls \"(.c\" \"(.h\""
at_fn_check_prepare_trace "output.at:216"
( $at_check_trace; ls "(.c" "(.h"
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:216"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/output.at:216: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "output.at:216"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:216"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:216: \$CXX \$CXXFLAGS \$CPPFLAGS -o cxx.o -c \"(.c\""
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -o cxx.o -c \"(.c\"" "output.at:216"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -o cxx.o -c "(.c"
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:216"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_54
#AT_START_55
# 55. output.at:217: Output file name: )
at_setup_line='output.at:217'
at_fn_banner 2
at_desc="Output file name: )"
at_desc_line=" 55: $at_desc                            "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "55. output.at:217: testing ..."
  $at_traceon


# Skip if platform doesn't support file name.  For example, Cygwin
# doesn't support file names containing ":" or "\".
{ set +x
$as_echo "$at_srcdir/output.at:217: touch \").tmp\" || exit 77"
at_fn_check_prepare_trace "output.at:217"
( $at_check_trace; touch ").tmp" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:217"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >glr.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%glr-parser
%code {
  int yylex (void);
  void yyerror (const char *);
}
%%
start: {};
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/output.at:217: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o \").c\" --defines=\").h\" glr.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:217"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o ").c" --defines=").h" glr.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:217"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:217: bison --xml=xml-tests/test.xml -o \").c\" --defines=\").h\" glr.y"
at_fn_check_prepare_trace "output.at:217"
( $at_check_trace; bison --xml=xml-tests/test.xml -o ").c" --defines=").h" glr.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:217"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:217: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:217"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:217"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/output.at:217: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:217"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:217"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/output.at:217: bison -o \").c\" --defines=\").h\" glr.y"
at_fn_check_prepare_trace "output.at:217"
( $at_check_trace; bison -o ").c" --defines=").h" glr.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:217"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:217: ls \").c\" \").h\""
at_fn_check_prepare_trace "output.at:217"
( $at_check_trace; ls ").c" ").h"
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:217"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:217: \$CC \$CFLAGS \$CPPFLAGS -o glr.o -c \").c\""
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -o glr.o -c \").c\"" "output.at:217"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -o glr.o -c ").c"
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:217"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >cxx.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%skeleton "lalr1.cc"
%code { int yylex (yy::parser::semantic_type*); }
%%
start: {};
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/output.at:217: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o \").c\" --defines=\").h\" cxx.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:217"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o ").c" --defines=").h" cxx.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:217"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:217: bison --xml=xml-tests/test.xml -o \").c\" --defines=\").h\" cxx.y"
at_fn_check_prepare_trace "output.at:217"
( $at_check_trace; bison --xml=xml-tests/test.xml -o ").c" --defines=").h" cxx.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:217"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:217: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:217"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:217"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/output.at:217: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:217"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:217"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/output.at:217: bison -o \").c\" --defines=\").h\" cxx.y"
at_fn_check_prepare_trace "output.at:217"
( $at_check_trace; bison -o ").c" --defines=").h" cxx.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:217"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:217: ls \").c\" \").h\""
at_fn_check_prepare_trace "output.at:217"
( $at_check_trace; ls ").c" ").h"
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:217"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/output.at:217: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "output.at:217"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:217"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:217: \$CXX \$CXXFLAGS \$CPPFLAGS -o cxx.o -c \").c\""
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -o cxx.o -c \").c\"" "output.at:217"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -o cxx.o -c ").c"
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:217"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_55
#AT_START_56
# 56. output.at:218: Output file name: #
at_setup_line='output.at:218'
at_fn_banner 2
at_desc="Output file name: #"
at_desc_line=" 56: $at_desc                            "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "56. output.at:218: testing ..."
  $at_traceon


# Skip if platform doesn't support file name.  For example, Cygwin
# doesn't support file names containing ":" or "\".
{ set +x
$as_echo "$at_srcdir/output.at:218: touch \"#.tmp\" || exit 77"
at_fn_check_prepare_trace "output.at:218"
( $at_check_trace; touch "#.tmp" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:218"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >glr.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%glr-parser
%code {
  int yylex (void);
  void yyerror (const char *);
}
%%
start: {};
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/output.at:218: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o \"#.c\" --defines=\"#.h\" glr.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:218"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o "#.c" --defines="#.h" glr.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:218"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:218: bison --xml=xml-tests/test.xml -o \"#.c\" --defines=\"#.h\" glr.y"
at_fn_check_prepare_trace "output.at:218"
( $at_check_trace; bison --xml=xml-tests/test.xml -o "#.c" --defines="#.h" glr.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:218"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:218: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:218"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:218"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/output.at:218: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:218"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:218"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/output.at:218: bison -o \"#.c\" --defines=\"#.h\" glr.y"
at_fn_check_prepare_trace "output.at:218"
( $at_check_trace; bison -o "#.c" --defines="#.h" glr.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:218"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:218: ls \"#.c\" \"#.h\""
at_fn_check_prepare_trace "output.at:218"
( $at_check_trace; ls "#.c" "#.h"
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:218"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:218: \$CC \$CFLAGS \$CPPFLAGS -o glr.o -c \"#.c\""
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -o glr.o -c \"#.c\"" "output.at:218"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -o glr.o -c "#.c"
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:218"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >cxx.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%skeleton "lalr1.cc"
%code { int yylex (yy::parser::semantic_type*); }
%%
start: {};
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/output.at:218: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o \"#.c\" --defines=\"#.h\" cxx.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:218"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o "#.c" --defines="#.h" cxx.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:218"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:218: bison --xml=xml-tests/test.xml -o \"#.c\" --defines=\"#.h\" cxx.y"
at_fn_check_prepare_trace "output.at:218"
( $at_check_trace; bison --xml=xml-tests/test.xml -o "#.c" --defines="#.h" cxx.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:218"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:218: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:218"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:218"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/output.at:218: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:218"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:218"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/output.at:218: bison -o \"#.c\" --defines=\"#.h\" cxx.y"
at_fn_check_prepare_trace "output.at:218"
( $at_check_trace; bison -o "#.c" --defines="#.h" cxx.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:218"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:218: ls \"#.c\" \"#.h\""
at_fn_check_prepare_trace "output.at:218"
( $at_check_trace; ls "#.c" "#.h"
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:218"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/output.at:218: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "output.at:218"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:218"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:218: \$CXX \$CXXFLAGS \$CPPFLAGS -o cxx.o -c \"#.c\""
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -o cxx.o -c \"#.c\"" "output.at:218"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -o cxx.o -c "#.c"
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:218"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_56
#AT_START_57
# 57. output.at:219: Output file name: @@
at_setup_line='output.at:219'
at_fn_banner 2
at_desc="Output file name: @@"
at_desc_line=" 57: $at_desc                           "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "57. output.at:219: testing ..."
  $at_traceon


# Skip if platform doesn't support file name.  For example, Cygwin
# doesn't support file names containing ":" or "\".
{ set +x
$as_echo "$at_srcdir/output.at:219: touch \"@@.tmp\" || exit 77"
at_fn_check_prepare_trace "output.at:219"
( $at_check_trace; touch "@@.tmp" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:219"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >glr.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%glr-parser
%code {
  int yylex (void);
  void yyerror (const char *);
}
%%
start: {};
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/output.at:219: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o \"@@.c\" --defines=\"@@.h\" glr.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:219"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o "@@.c" --defines="@@.h" glr.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:219"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:219: bison --xml=xml-tests/test.xml -o \"@@.c\" --defines=\"@@.h\" glr.y"
at_fn_check_prepare_trace "output.at:219"
( $at_check_trace; bison --xml=xml-tests/test.xml -o "@@.c" --defines="@@.h" glr.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:219"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:219: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:219"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:219"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/output.at:219: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:219"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:219"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/output.at:219: bison -o \"@@.c\" --defines=\"@@.h\" glr.y"
at_fn_check_prepare_trace "output.at:219"
( $at_check_trace; bison -o "@@.c" --defines="@@.h" glr.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:219"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:219: ls \"@@.c\" \"@@.h\""
at_fn_check_prepare_trace "output.at:219"
( $at_check_trace; ls "@@.c" "@@.h"
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:219"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:219: \$CC \$CFLAGS \$CPPFLAGS -o glr.o -c \"@@.c\""
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -o glr.o -c \"@@.c\"" "output.at:219"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -o glr.o -c "@@.c"
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:219"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >cxx.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%skeleton "lalr1.cc"
%code { int yylex (yy::parser::semantic_type*); }
%%
start: {};
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/output.at:219: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o \"@@.c\" --defines=\"@@.h\" cxx.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:219"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o "@@.c" --defines="@@.h" cxx.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:219"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:219: bison --xml=xml-tests/test.xml -o \"@@.c\" --defines=\"@@.h\" cxx.y"
at_fn_check_prepare_trace "output.at:219"
( $at_check_trace; bison --xml=xml-tests/test.xml -o "@@.c" --defines="@@.h" cxx.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:219"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:219: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:219"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:219"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/output.at:219: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:219"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:219"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/output.at:219: bison -o \"@@.c\" --defines=\"@@.h\" cxx.y"
at_fn_check_prepare_trace "output.at:219"
( $at_check_trace; bison -o "@@.c" --defines="@@.h" cxx.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:219"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:219: ls \"@@.c\" \"@@.h\""
at_fn_check_prepare_trace "output.at:219"
( $at_check_trace; ls "@@.c" "@@.h"
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:219"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/output.at:219: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "output.at:219"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:219"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:219: \$CXX \$CXXFLAGS \$CPPFLAGS -o cxx.o -c \"@@.c\""
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -o cxx.o -c \"@@.c\"" "output.at:219"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -o cxx.o -c "@@.c"
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:219"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_57
#AT_START_58
# 58. output.at:220: Output file name: @{
at_setup_line='output.at:220'
at_fn_banner 2
at_desc="Output file name: @{"
at_desc_line=" 58: $at_desc                           "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "58. output.at:220: testing ..."
  $at_traceon


# Skip if platform doesn't support file name.  For example, Cygwin
# doesn't support file names containing ":" or "\".
{ set +x
$as_echo "$at_srcdir/output.at:220: touch \"@{.tmp\" || exit 77"
at_fn_check_prepare_trace "output.at:220"
( $at_check_trace; touch "@{.tmp" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:220"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >glr.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%glr-parser
%code {
  int yylex (void);
  void yyerror (const char *);
}
%%
start: {};
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/output.at:220: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o \"@{.c\" --defines=\"@{.h\" glr.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:220"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o "@{.c" --defines="@{.h" glr.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:220"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:220: bison --xml=xml-tests/test.xml -o \"@{.c\" --defines=\"@{.h\" glr.y"
at_fn_check_prepare_trace "output.at:220"
( $at_check_trace; bison --xml=xml-tests/test.xml -o "@{.c" --defines="@{.h" glr.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:220"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:220: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:220"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:220"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/output.at:220: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:220"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:220"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/output.at:220: bison -o \"@{.c\" --defines=\"@{.h\" glr.y"
at_fn_check_prepare_trace "output.at:220"
( $at_check_trace; bison -o "@{.c" --defines="@{.h" glr.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:220"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:220: ls \"@{.c\" \"@{.h\""
at_fn_check_prepare_trace "output.at:220"
( $at_check_trace; ls "@{.c" "@{.h"
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:220"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:220: \$CC \$CFLAGS \$CPPFLAGS -o glr.o -c \"@{.c\""
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -o glr.o -c \"@{.c\"" "output.at:220"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -o glr.o -c "@{.c"
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:220"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >cxx.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%skeleton "lalr1.cc"
%code { int yylex (yy::parser::semantic_type*); }
%%
start: {};
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/output.at:220: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o \"@{.c\" --defines=\"@{.h\" cxx.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:220"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o "@{.c" --defines="@{.h" cxx.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:220"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:220: bison --xml=xml-tests/test.xml -o \"@{.c\" --defines=\"@{.h\" cxx.y"
at_fn_check_prepare_trace "output.at:220"
( $at_check_trace; bison --xml=xml-tests/test.xml -o "@{.c" --defines="@{.h" cxx.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:220"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:220: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:220"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:220"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/output.at:220: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:220"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:220"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/output.at:220: bison -o \"@{.c\" --defines=\"@{.h\" cxx.y"
at_fn_check_prepare_trace "output.at:220"
( $at_check_trace; bison -o "@{.c" --defines="@{.h" cxx.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:220"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:220: ls \"@{.c\" \"@{.h\""
at_fn_check_prepare_trace "output.at:220"
( $at_check_trace; ls "@{.c" "@{.h"
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:220"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/output.at:220: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "output.at:220"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:220"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:220: \$CXX \$CXXFLAGS \$CPPFLAGS -o cxx.o -c \"@{.c\""
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -o cxx.o -c \"@{.c\"" "output.at:220"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -o cxx.o -c "@{.c"
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:220"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_58
#AT_START_59
# 59. output.at:221: Output file name: @}
at_setup_line='output.at:221'
at_fn_banner 2
at_desc="Output file name: @}"
at_desc_line=" 59: $at_desc                           "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "59. output.at:221: testing ..."
  $at_traceon


# Skip if platform doesn't support file name.  For example, Cygwin
# doesn't support file names containing ":" or "\".
{ set +x
$as_echo "$at_srcdir/output.at:221: touch \"@}.tmp\" || exit 77"
at_fn_check_prepare_trace "output.at:221"
( $at_check_trace; touch "@}.tmp" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:221"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >glr.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%glr-parser
%code {
  int yylex (void);
  void yyerror (const char *);
}
%%
start: {};
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/output.at:221: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o \"@}.c\" --defines=\"@}.h\" glr.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:221"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o "@}.c" --defines="@}.h" glr.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:221"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:221: bison --xml=xml-tests/test.xml -o \"@}.c\" --defines=\"@}.h\" glr.y"
at_fn_check_prepare_trace "output.at:221"
( $at_check_trace; bison --xml=xml-tests/test.xml -o "@}.c" --defines="@}.h" glr.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:221"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:221: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:221"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:221"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/output.at:221: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:221"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:221"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/output.at:221: bison -o \"@}.c\" --defines=\"@}.h\" glr.y"
at_fn_check_prepare_trace "output.at:221"
( $at_check_trace; bison -o "@}.c" --defines="@}.h" glr.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:221"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:221: ls \"@}.c\" \"@}.h\""
at_fn_check_prepare_trace "output.at:221"
( $at_check_trace; ls "@}.c" "@}.h"
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:221"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:221: \$CC \$CFLAGS \$CPPFLAGS -o glr.o -c \"@}.c\""
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -o glr.o -c \"@}.c\"" "output.at:221"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -o glr.o -c "@}.c"
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:221"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >cxx.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%skeleton "lalr1.cc"
%code { int yylex (yy::parser::semantic_type*); }
%%
start: {};
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/output.at:221: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o \"@}.c\" --defines=\"@}.h\" cxx.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:221"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o "@}.c" --defines="@}.h" cxx.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:221"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:221: bison --xml=xml-tests/test.xml -o \"@}.c\" --defines=\"@}.h\" cxx.y"
at_fn_check_prepare_trace "output.at:221"
( $at_check_trace; bison --xml=xml-tests/test.xml -o "@}.c" --defines="@}.h" cxx.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:221"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:221: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:221"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:221"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/output.at:221: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:221"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:221"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/output.at:221: bison -o \"@}.c\" --defines=\"@}.h\" cxx.y"
at_fn_check_prepare_trace "output.at:221"
( $at_check_trace; bison -o "@}.c" --defines="@}.h" cxx.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:221"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:221: ls \"@}.c\" \"@}.h\""
at_fn_check_prepare_trace "output.at:221"
( $at_check_trace; ls "@}.c" "@}.h"
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:221"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/output.at:221: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "output.at:221"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:221"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:221: \$CXX \$CXXFLAGS \$CPPFLAGS -o cxx.o -c \"@}.c\""
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -o cxx.o -c \"@}.c\"" "output.at:221"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -o cxx.o -c "@}.c"
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:221"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_59
#AT_START_60
# 60. output.at:222: Output file name: [
at_setup_line='output.at:222'
at_fn_banner 2
at_desc="Output file name: ["
at_desc_line=" 60: $at_desc                            "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "60. output.at:222: testing ..."
  $at_traceon


# Skip if platform doesn't support file name.  For example, Cygwin
# doesn't support file names containing ":" or "\".
{ set +x
$as_echo "$at_srcdir/output.at:222: touch \"[.tmp\" || exit 77"
at_fn_check_prepare_trace "output.at:222"
( $at_check_trace; touch "[.tmp" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:222"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >glr.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%glr-parser
%code {
  int yylex (void);
  void yyerror (const char *);
}
%%
start: {};
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/output.at:222: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o \"[.c\" --defines=\"[.h\" glr.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:222"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o "[.c" --defines="[.h" glr.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:222"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:222: bison --xml=xml-tests/test.xml -o \"[.c\" --defines=\"[.h\" glr.y"
at_fn_check_prepare_trace "output.at:222"
( $at_check_trace; bison --xml=xml-tests/test.xml -o "[.c" --defines="[.h" glr.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:222"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:222: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:222"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:222"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/output.at:222: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:222"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:222"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/output.at:222: bison -o \"[.c\" --defines=\"[.h\" glr.y"
at_fn_check_prepare_trace "output.at:222"
( $at_check_trace; bison -o "[.c" --defines="[.h" glr.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:222"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:222: ls \"[.c\" \"[.h\""
at_fn_check_prepare_trace "output.at:222"
( $at_check_trace; ls "[.c" "[.h"
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:222"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:222: \$CC \$CFLAGS \$CPPFLAGS -o glr.o -c \"[.c\""
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -o glr.o -c \"[.c\"" "output.at:222"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -o glr.o -c "[.c"
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:222"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >cxx.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%skeleton "lalr1.cc"
%code { int yylex (yy::parser::semantic_type*); }
%%
start: {};
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/output.at:222: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o \"[.c\" --defines=\"[.h\" cxx.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:222"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o "[.c" --defines="[.h" cxx.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:222"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:222: bison --xml=xml-tests/test.xml -o \"[.c\" --defines=\"[.h\" cxx.y"
at_fn_check_prepare_trace "output.at:222"
( $at_check_trace; bison --xml=xml-tests/test.xml -o "[.c" --defines="[.h" cxx.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:222"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:222: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:222"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:222"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/output.at:222: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:222"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:222"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/output.at:222: bison -o \"[.c\" --defines=\"[.h\" cxx.y"
at_fn_check_prepare_trace "output.at:222"
( $at_check_trace; bison -o "[.c" --defines="[.h" cxx.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:222"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:222: ls \"[.c\" \"[.h\""
at_fn_check_prepare_trace "output.at:222"
( $at_check_trace; ls "[.c" "[.h"
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:222"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/output.at:222: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "output.at:222"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:222"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:222: \$CXX \$CXXFLAGS \$CPPFLAGS -o cxx.o -c \"[.c\""
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -o cxx.o -c \"[.c\"" "output.at:222"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -o cxx.o -c "[.c"
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:222"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_60
#AT_START_61
# 61. output.at:223: Output file name: ]
at_setup_line='output.at:223'
at_fn_banner 2
at_desc="Output file name: ]"
at_desc_line=" 61: $at_desc                            "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "61. output.at:223: testing ..."
  $at_traceon


# Skip if platform doesn't support file name.  For example, Cygwin
# doesn't support file names containing ":" or "\".
{ set +x
$as_echo "$at_srcdir/output.at:223: touch \"].tmp\" || exit 77"
at_fn_check_prepare_trace "output.at:223"
( $at_check_trace; touch "].tmp" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:223"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >glr.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%glr-parser
%code {
  int yylex (void);
  void yyerror (const char *);
}
%%
start: {};
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/output.at:223: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o \"].c\" --defines=\"].h\" glr.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:223"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o "].c" --defines="].h" glr.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:223"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:223: bison --xml=xml-tests/test.xml -o \"].c\" --defines=\"].h\" glr.y"
at_fn_check_prepare_trace "output.at:223"
( $at_check_trace; bison --xml=xml-tests/test.xml -o "].c" --defines="].h" glr.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:223"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:223: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:223"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:223"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/output.at:223: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:223"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:223"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/output.at:223: bison -o \"].c\" --defines=\"].h\" glr.y"
at_fn_check_prepare_trace "output.at:223"
( $at_check_trace; bison -o "].c" --defines="].h" glr.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:223"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:223: ls \"].c\" \"].h\""
at_fn_check_prepare_trace "output.at:223"
( $at_check_trace; ls "].c" "].h"
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:223"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:223: \$CC \$CFLAGS \$CPPFLAGS -o glr.o -c \"].c\""
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -o glr.o -c \"].c\"" "output.at:223"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -o glr.o -c "].c"
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:223"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >cxx.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%skeleton "lalr1.cc"
%code { int yylex (yy::parser::semantic_type*); }
%%
start: {};
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/output.at:223: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o \"].c\" --defines=\"].h\" cxx.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:223"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o "].c" --defines="].h" cxx.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:223"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/output.at:223: bison --xml=xml-tests/test.xml -o \"].c\" --defines=\"].h\" cxx.y"
at_fn_check_prepare_trace "output.at:223"
( $at_check_trace; bison --xml=xml-tests/test.xml -o "].c" --defines="].h" cxx.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:223"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/output.at:223: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:223"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:223"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/output.at:223: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:223"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:223"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/output.at:223: bison -o \"].c\" --defines=\"].h\" cxx.y"
at_fn_check_prepare_trace "output.at:223"
( $at_check_trace; bison -o "].c" --defines="].h" cxx.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:223"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:223: ls \"].c\" \"].h\""
at_fn_check_prepare_trace "output.at:223"
( $at_check_trace; ls "].c" "].h"
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:223"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/output.at:223: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "output.at:223"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:223"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/output.at:223: \$CXX \$CXXFLAGS \$CPPFLAGS -o cxx.o -c \"].c\""
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -o cxx.o -c \"].c\"" "output.at:223"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -o cxx.o -c "].c"
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:223"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_61
#AT_START_62
# 62. skeletons.at:23: Relative skeleton file names
at_setup_line='skeletons.at:23'
at_fn_banner 3
at_desc="Relative skeleton file names"
at_desc_line=" 62: $at_desc                   "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "62. skeletons.at:23: testing ..."
  $at_traceon


{ set +x
$as_echo "$at_srcdir/skeletons.at:25: mkdir tmp"
at_fn_check_prepare_trace "skeletons.at:25"
( $at_check_trace; mkdir tmp
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:25"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >tmp/skel.c <<'_ATEOF'
m4_divert_push(0)dnl
@output(b4_parser_file_name@)dnl
b4_percent_define_get([[test]])
m4_divert_pop(0)
_ATEOF


cat >skel.c <<'_ATEOF'
m4_divert_push(0)dnl
@output(b4_parser_file_name@)dnl
b4_percent_define_get([[test]]) -- Local
m4_divert_pop(0)
_ATEOF


cat >tmp/input-gram.y <<'_ATEOF'
%skeleton "./skel.c"
%define test "Hello World"
%%
start: ;
_ATEOF


cat >input-gram.y <<'_ATEOF'
%skeleton "./skel.c"
%define test "Hello World"
%%
start: ;
_ATEOF


cat >tmp/input-cmd-line.y <<'_ATEOF'
%define test "Hello World"
%%
start: ;
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/skeletons.at:61: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot tmp/input-gram.y"
at_fn_check_prepare_notrace 'an embedded newline' "skeletons.at:61"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot tmp/input-gram.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:61"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/skeletons.at:61: bison --xml=xml-tests/test.xml tmp/input-gram.y"
at_fn_check_prepare_trace "skeletons.at:61"
( $at_check_trace; bison --xml=xml-tests/test.xml tmp/input-gram.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:61"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/skeletons.at:61: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "skeletons.at:61"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:61"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/skeletons.at:61: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "skeletons.at:61"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:61"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/skeletons.at:61: bison tmp/input-gram.y"
at_fn_check_prepare_trace "skeletons.at:61"
( $at_check_trace; bison tmp/input-gram.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:61"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/skeletons.at:62: cat input-gram.tab.c"
at_fn_check_prepare_trace "skeletons.at:62"
( $at_check_trace; cat input-gram.tab.c
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "Hello World
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:62"
$at_failed && at_fn_log_failure
$at_traceon; }


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/skeletons.at:66: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot input-gram.y"
at_fn_check_prepare_notrace 'an embedded newline' "skeletons.at:66"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot input-gram.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:66"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/skeletons.at:66: bison --xml=xml-tests/test.xml input-gram.y"
at_fn_check_prepare_trace "skeletons.at:66"
( $at_check_trace; bison --xml=xml-tests/test.xml input-gram.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:66"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/skeletons.at:66: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "skeletons.at:66"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:66"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/skeletons.at:66: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "skeletons.at:66"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:66"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/skeletons.at:66: bison input-gram.y"
at_fn_check_prepare_trace "skeletons.at:66"
( $at_check_trace; bison input-gram.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:66"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/skeletons.at:67: cat input-gram.tab.c"
at_fn_check_prepare_trace "skeletons.at:67"
( $at_check_trace; cat input-gram.tab.c
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "Hello World -- Local
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:67"
$at_failed && at_fn_log_failure
$at_traceon; }


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/skeletons.at:71: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot --skeleton=tmp/skel.c tmp/input-cmd-line.y"
at_fn_check_prepare_notrace 'an embedded newline' "skeletons.at:71"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot --skeleton=tmp/skel.c tmp/input-cmd-line.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:71"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/skeletons.at:71: bison --xml=xml-tests/test.xml --skeleton=tmp/skel.c tmp/input-cmd-line.y"
at_fn_check_prepare_trace "skeletons.at:71"
( $at_check_trace; bison --xml=xml-tests/test.xml --skeleton=tmp/skel.c tmp/input-cmd-line.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:71"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/skeletons.at:71: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "skeletons.at:71"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:71"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/skeletons.at:71: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "skeletons.at:71"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:71"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/skeletons.at:71: bison --skeleton=tmp/skel.c tmp/input-cmd-line.y"
at_fn_check_prepare_trace "skeletons.at:71"
( $at_check_trace; bison --skeleton=tmp/skel.c tmp/input-cmd-line.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:71"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/skeletons.at:72: cat input-cmd-line.tab.c"
at_fn_check_prepare_trace "skeletons.at:72"
( $at_check_trace; cat input-cmd-line.tab.c
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "Hello World
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:72"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_62
#AT_START_63
# 63. skeletons.at:83: Installed skeleton file names
at_setup_line='skeletons.at:83'
at_fn_banner 3
at_desc="Installed skeleton file names"
at_desc_line=" 63: $at_desc                  "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "63. skeletons.at:83: testing ..."
  $at_traceon




cat >input-cmd-line.y <<'_ATEOF'
%{
  #include <stdio.h>
  void yyerror (char const *msg);
  int yylex (void);
%}

%error-verbose
%token 'a'

%%

start: ;

%%

void
yyerror (char const *msg)
{
  fprintf (stderr, "%s\n", msg);
}

int
yylex (void)
{
  return 'a';
}

int
main (void)
{
  return yyparse ();
}
_ATEOF


cat >input-gram.y <<'_ATEOF'
%skeleton "yacc.c"
%{
  #include <stdio.h>
  void yyerror (char const *msg);
  int yylex (void);
%}

%error-verbose
%token 'a'

%%

start: ;

%%

void
yyerror (char const *msg)
{
  fprintf (stderr, "%s\n", msg);
}

int
yylex (void)
{
  return 'a';
}

int
main (void)
{
  return yyparse ();
}
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/skeletons.at:127: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot --skeleton=yacc.c -o input-cmd-line.c input-cmd-line.y"
at_fn_check_prepare_notrace 'an embedded newline' "skeletons.at:127"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot --skeleton=yacc.c -o input-cmd-line.c input-cmd-line.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:127"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/skeletons.at:127: bison --xml=xml-tests/test.xml --skeleton=yacc.c -o input-cmd-line.c input-cmd-line.y"
at_fn_check_prepare_trace "skeletons.at:127"
( $at_check_trace; bison --xml=xml-tests/test.xml --skeleton=yacc.c -o input-cmd-line.c input-cmd-line.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:127"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/skeletons.at:127: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "skeletons.at:127"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:127"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/skeletons.at:127: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "skeletons.at:127"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:127"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/skeletons.at:127: bison --skeleton=yacc.c -o input-cmd-line.c input-cmd-line.y"
at_fn_check_prepare_trace "skeletons.at:127"
( $at_check_trace; bison --skeleton=yacc.c -o input-cmd-line.c input-cmd-line.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:127"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/skeletons.at:128: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input-cmd-line input-cmd-line.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input-cmd-line input-cmd-line.c $LIBS" "skeletons.at:128"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input-cmd-line input-cmd-line.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/skeletons.at:129:  \$PREPARSER ./input-cmd-line"
at_fn_check_prepare_dynamic " $PREPARSER ./input-cmd-line" "skeletons.at:129"
( $at_check_trace;  $PREPARSER ./input-cmd-line
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'a', expecting \$end
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:129"
$at_failed && at_fn_log_failure
$at_traceon; }


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/skeletons.at:133: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input-gram.c input-gram.y"
at_fn_check_prepare_notrace 'an embedded newline' "skeletons.at:133"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input-gram.c input-gram.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:133"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/skeletons.at:133: bison --xml=xml-tests/test.xml -o input-gram.c input-gram.y"
at_fn_check_prepare_trace "skeletons.at:133"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input-gram.c input-gram.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:133"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/skeletons.at:133: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "skeletons.at:133"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:133"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/skeletons.at:133: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "skeletons.at:133"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:133"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/skeletons.at:133: bison -o input-gram.c input-gram.y"
at_fn_check_prepare_trace "skeletons.at:133"
( $at_check_trace; bison -o input-gram.c input-gram.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:133"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/skeletons.at:134: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input-gram input-gram.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input-gram input-gram.c $LIBS" "skeletons.at:134"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input-gram input-gram.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:134"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/skeletons.at:135:  \$PREPARSER ./input-gram"
at_fn_check_prepare_dynamic " $PREPARSER ./input-gram" "skeletons.at:135"
( $at_check_trace;  $PREPARSER ./input-gram
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'a', expecting \$end
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:135"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_63
#AT_START_64
# 64. skeletons.at:148: %define Boolean variables: invalid skeleton defaults
at_setup_line='skeletons.at:148'
at_fn_banner 3
at_desc="%define Boolean variables: invalid skeleton defaults"
at_desc_line=" 64: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "64. skeletons.at:148: testing ..."
  $at_traceon


cat >skel.c <<'_ATEOF'
b4_percent_define_default([[foo]], [[bogus value]])
b4_percent_define_flag_if([[foo]])
_ATEOF


cat >input.y <<'_ATEOF'
%skeleton "./skel.c"
%%
start: ;
_ATEOF



{ set +x
$as_echo "$at_srcdir/skeletons.at:161: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "skeletons.at:161"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "<skeleton default value>: invalid value for %define Boolean variable \`foo'
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:161"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_64
#AT_START_65
# 65. skeletons.at:172: Complaining during macro argument expansion
at_setup_line='skeletons.at:172'
at_fn_banner 3
at_desc="Complaining during macro argument expansion"
at_desc_line=" 65: $at_desc    "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "65. skeletons.at:172: testing ..."
  $at_traceon


cat >skel1.c <<'_ATEOF'
m4_define([foow], [b4_warn([[foow fubar]])])
m4_define([foowat], [b4_warn_at([[foow.y:2.3]],
                                    [[foow.y:5.4]], [[foowat fubar]])])
m4_define([fooc], [b4_complain([[fooc fubar]])])
m4_define([foocat], [b4_complain_at([[fooc.y:1.1]],
                                        [[fooc.y:10.6]], [[foocat fubar]])])
m4_define([foof], [b4_fatal([[foof fubar]])])
m4_if(foow, [1], [yes])
m4_if(foowat, [1], [yes])
m4_if(fooc, [1], [yes])
m4_if(foocat, [1], [yes])
m4_if(foof, [1], [yes])
_ATEOF


cat >input1.y <<'_ATEOF'
%skeleton "./skel1.c"
%%
start: ;
_ATEOF



{ set +x
$as_echo "$at_srcdir/skeletons.at:195: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input1.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input1.y" "skeletons.at:195"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input1.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input1.y: warning: foow fubar
foow.y:2.3-5.3: warning: foowat fubar
input1.y: fooc fubar
fooc.y:1.1-10.5: foocat fubar
input1.y: fatal error: foof fubar
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:195"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >skel2.c <<'_ATEOF'
m4_define([foofat], [b4_fatal_at([[foof.y:12.11]],
                                       [[foof.y:100.123]], [[foofat fubar]])])
m4_if(foofat, [1], [yes])
_ATEOF


cat >input2.y <<'_ATEOF'
%skeleton "./skel2.c"
%%
start: ;
_ATEOF



{ set +x
$as_echo "$at_srcdir/skeletons.at:215: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input2.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input2.y" "skeletons.at:215"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input2.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "foof.y:12.11-100.122: fatal error: foofat fubar
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:215"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >skel3.c <<'_ATEOF'
b4_complain_at(b4_percent_define_get_loc([[bogus]]), [[bad value]])
_ATEOF


cat >input3.y <<'_ATEOF'
%skeleton "./skel3.c"
%%
start: ;
_ATEOF



{ set +x
$as_echo "$at_srcdir/skeletons.at:229: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input3.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input3.y" "skeletons.at:229"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input3.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input3.y: fatal error: undefined %define variable \`bogus' passed to b4_percent_define_get_loc
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:229"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >skel4.c <<'_ATEOF'
b4_warn_at(b4_percent_define_get_syncline([[bogus]]), [[bad value]])
_ATEOF


cat >input4.y <<'_ATEOF'
%skeleton "./skel4.c"
%%
start: ;
_ATEOF



{ set +x
$as_echo "$at_srcdir/skeletons.at:243: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input4.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input4.y" "skeletons.at:243"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input4.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input4.y: fatal error: undefined %define variable \`bogus' passed to b4_percent_define_get_syncline
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:243"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_65
#AT_START_66
# 66. skeletons.at:254: Fatal errors make M4 exit immediately
at_setup_line='skeletons.at:254'
at_fn_banner 3
at_desc="Fatal errors make M4 exit immediately"
at_desc_line=" 66: $at_desc          "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "66. skeletons.at:254: testing ..."
  $at_traceon


cat >skel1.c <<'_ATEOF'
b4_complain([[non-fatal error]])
b4_fatal([[M4 should exit immediately here]])
m4_fatal([this should never be evaluated])
_ATEOF


cat >input1.y <<'_ATEOF'
%skeleton "./skel1.c"
%%
start: ;
_ATEOF



{ set +x
$as_echo "$at_srcdir/skeletons.at:268: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input1.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input1.y" "skeletons.at:268"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input1.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input1.y: non-fatal error
input1.y: fatal error: M4 should exit immediately here
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:268"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >skel2.c <<'_ATEOF'
b4_warn([[morning]])
b4_fatal_at([[foo.y:1.5]], [[foo.y:1.7]], [[M4 should exit immediately here]])
m4_fatal([this should never be evaluated])
_ATEOF


cat >input2.y <<'_ATEOF'
%skeleton "./skel2.c"
%%
start: ;
_ATEOF



{ set +x
$as_echo "$at_srcdir/skeletons.at:285: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input2.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input2.y" "skeletons.at:285"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input2.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input2.y: warning: morning
foo.y:1.5-6: fatal error: M4 should exit immediately here
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:285"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_66
#AT_START_67
# 67. skeletons.at:308: Fatal errors but M4 continues producing output
at_setup_line='skeletons.at:308'
at_fn_banner 3
at_desc="Fatal errors but M4 continues producing output"
at_desc_line=" 67: $at_desc "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "67. skeletons.at:308: testing ..."
  $at_traceon


cat >gen-skel.pl <<'_ATEOF'
use warnings;
use strict;
my $M4 = "m4";
my $DNL = "d"."nl";
print "${M4}_divert_push(0)$DNL\n";
print '@output(@,@)', "\n";
(print "garbage"x10, "\n") for (1..1000);
print "${M4}_divert_pop(0)\n";
_ATEOF

{ set +x
$as_echo "$at_srcdir/skeletons.at:320: perl gen-skel.pl > skel.c || exit 77"
at_fn_check_prepare_trace "skeletons.at:320"
( $at_check_trace; perl gen-skel.pl > skel.c || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:320"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input.y <<'_ATEOF'
%skeleton "./skel.c"
%%
start: ;
_ATEOF



{ set +x
$as_echo "$at_srcdir/skeletons.at:328: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "skeletons.at:328"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y: fatal error: too many arguments for @output directive in skeleton
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:328"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_67
#AT_START_68
# 68. sets.at:65: Nullable
at_setup_line='sets.at:65'
at_fn_banner 4
at_desc="Nullable"
at_desc_line=" 68: $at_desc                                       "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "68. sets.at:65: testing ..."
  $at_traceon


# At some point, nullable had been smoking grass, and managed to say:
#
# Entering set_nullable
# NULLABLE
#         'e': yes
#         (null): no
# ...

cat >input.y <<'_ATEOF'
%%
e: 'e' | /* Nothing */;
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/sets.at:80: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot --trace=sets input.y"
at_fn_check_prepare_notrace 'an embedded newline' "sets.at:80"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot --trace=sets input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:80"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/sets.at:80: bison --xml=xml-tests/test.xml --trace=sets input.y"
at_fn_check_prepare_trace "sets.at:80"
( $at_check_trace; bison --xml=xml-tests/test.xml --trace=sets input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:80"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/sets.at:80: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "sets.at:80"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:80"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/sets.at:80: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "sets.at:80"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:80"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/sets.at:80: bison --trace=sets input.y"
at_fn_check_prepare_trace "sets.at:80"
( $at_check_trace; bison --trace=sets input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:80"
$at_failed && at_fn_log_failure
$at_traceon; }

cat >extract.sed <<'_ATEOF'
#n
/^NULLABLE$/ {
   :null
   p
   n
   /^[	 ]*$/ !b null
}
/^FIRSTS$/ {
   :firsts
   p
   n
   /^[	 ]*$/ !b firsts
}
/^FDERIVES$/ {
   :fderiv
   p
   n
   /^[	 ]*$/ !b fderiv
}
/^DERIVES$/ {
   :deriv
   p
   n
   /^[	 ]*$/ !b deriv
}
_ATEOF

{ set +x
$as_echo "$at_srcdir/sets.at:81: sed -f extract.sed stderr"
at_fn_check_prepare_trace "sets.at:81"
( $at_check_trace; sed -f extract.sed stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:81"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/sets.at:81: mv stdout sets"
at_fn_check_prepare_trace "sets.at:81"
( $at_check_trace; mv stdout sets
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:81"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/sets.at:82: cat sets"
at_fn_check_prepare_trace "sets.at:82"
( $at_check_trace; cat sets
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "DERIVES
	\$accept derives
		  0  e \$end
	e derives
		  1  'e'
		  2  /* empty */
NULLABLE
	\$accept: no
	e: yes
FIRSTS
	\$accept firsts
		\$accept
		e
	e firsts
		e
FDERIVES
	\$accept derives
		  0  e \$end
		  1  'e'
		  2  /* empty */
	e derives
		  1  'e'
		  2  /* empty */
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:82"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_68
#AT_START_69
# 69. sets.at:150: Broken Closure
at_setup_line='sets.at:150'
at_fn_banner 4
at_desc="Broken Closure"
at_desc_line=" 69: $at_desc                                 "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "69. sets.at:150: testing ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%%
a: b;
b: c;
c: d;
d: e;
e: f;
f: g;
g: h;
h: 'h';
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/sets.at:164: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot --trace=sets input.y"
at_fn_check_prepare_notrace 'an embedded newline' "sets.at:164"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot --trace=sets input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:164"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/sets.at:164: bison --xml=xml-tests/test.xml --trace=sets input.y"
at_fn_check_prepare_trace "sets.at:164"
( $at_check_trace; bison --xml=xml-tests/test.xml --trace=sets input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:164"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/sets.at:164: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "sets.at:164"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:164"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/sets.at:164: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "sets.at:164"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:164"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/sets.at:164: bison --trace=sets input.y"
at_fn_check_prepare_trace "sets.at:164"
( $at_check_trace; bison --trace=sets input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:164"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/sets.at:166: sed -n 's/[	 ]*\$//;/^RTC: Firsts Output BEGIN/,/^RTC: Firsts Output END/p' stderr"
at_fn_check_prepare_dynamic "sed -n 's/[	 ]*$//;/^RTC: Firsts Output BEGIN/,/^RTC: Firsts Output END/p' stderr" "sets.at:166"
( $at_check_trace; sed -n 's/[	 ]*$//;/^RTC: Firsts Output BEGIN/,/^RTC: Firsts Output END/p' stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "RTC: Firsts Output BEGIN

   012345678
  .---------.
 0|111111111|
 1| 11111111|
 2|  1111111|
 3|   111111|
 4|    11111|
 5|     1111|
 6|      111|
 7|       11|
 8|        1|
  \`---------'
RTC: Firsts Output END
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:166"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_69
#AT_START_70
# 70. sets.at:192: Firsts
at_setup_line='sets.at:192'
at_fn_banner 4
at_desc="Firsts"
at_desc_line=" 70: $at_desc                                         "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "70. sets.at:192: testing ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%nonassoc '<' '>'
%left '+' '-'
%right '^' '='
%%
exp:
   exp '<' exp
 | exp '>' exp
 | exp '+' exp
 | exp '-' exp
 | exp '^' exp
 | exp '=' exp
 | "exp"
 ;
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/sets.at:210: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot --trace=sets input.y"
at_fn_check_prepare_notrace 'an embedded newline' "sets.at:210"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot --trace=sets input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:210"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/sets.at:210: bison --xml=xml-tests/test.xml --trace=sets input.y"
at_fn_check_prepare_trace "sets.at:210"
( $at_check_trace; bison --xml=xml-tests/test.xml --trace=sets input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:210"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/sets.at:210: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "sets.at:210"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:210"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/sets.at:210: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "sets.at:210"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:210"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/sets.at:210: bison --trace=sets input.y"
at_fn_check_prepare_trace "sets.at:210"
( $at_check_trace; bison --trace=sets input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:210"
$at_failed && at_fn_log_failure
$at_traceon; }

cat >extract.sed <<'_ATEOF'
#n
/^NULLABLE$/ {
   :null
   p
   n
   /^[	 ]*$/ !b null
}
/^FIRSTS$/ {
   :firsts
   p
   n
   /^[	 ]*$/ !b firsts
}
/^FDERIVES$/ {
   :fderiv
   p
   n
   /^[	 ]*$/ !b fderiv
}
/^DERIVES$/ {
   :deriv
   p
   n
   /^[	 ]*$/ !b deriv
}
_ATEOF

{ set +x
$as_echo "$at_srcdir/sets.at:211: sed -f extract.sed stderr"
at_fn_check_prepare_trace "sets.at:211"
( $at_check_trace; sed -f extract.sed stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:211"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/sets.at:211: mv stdout sets"
at_fn_check_prepare_trace "sets.at:211"
( $at_check_trace; mv stdout sets
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:211"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/sets.at:212: cat sets"
at_fn_check_prepare_trace "sets.at:212"
( $at_check_trace; cat sets
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "DERIVES
	\$accept derives
		  0  exp \$end
	exp derives
		  1  exp '<' exp
		  2  exp '>' exp
		  3  exp '+' exp
		  4  exp '-' exp
		  5  exp '^' exp
		  6  exp '=' exp
		  7  \"exp\"
NULLABLE
	\$accept: no
	exp: no
FIRSTS
	\$accept firsts
		\$accept
		exp
	exp firsts
		exp
FDERIVES
	\$accept derives
		  0  exp \$end
		  1  exp '<' exp
		  2  exp '>' exp
		  3  exp '+' exp
		  4  exp '-' exp
		  5  exp '^' exp
		  6  exp '=' exp
		  7  \"exp\"
	exp derives
		  1  exp '<' exp
		  2  exp '>' exp
		  3  exp '+' exp
		  4  exp '-' exp
		  5  exp '^' exp
		  6  exp '=' exp
		  7  \"exp\"
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:212"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_70
#AT_START_71
# 71. sets.at:268: Accept
at_setup_line='sets.at:268'
at_fn_banner 4
at_desc="Accept"
at_desc_line=" 71: $at_desc                                         "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "71. sets.at:268: testing ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%token END 0
%%
input:
  'a'
| '(' input ')'
| '(' error END
;
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/sets.at:280: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -v -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "sets.at:280"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -v -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:280"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/sets.at:280: bison --xml=xml-tests/test.xml -v -o input.c input.y"
at_fn_check_prepare_trace "sets.at:280"
( $at_check_trace; bison --xml=xml-tests/test.xml -v -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:280"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/sets.at:280: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "sets.at:280"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:280"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/sets.at:280: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "sets.at:280"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:280"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/sets.at:280: bison -v -o input.c input.y"
at_fn_check_prepare_trace "sets.at:280"
( $at_check_trace; bison -v -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:280"
$at_failed && at_fn_log_failure
$at_traceon; }


# Get the final state in the parser.
{ set +x
$as_echo "$at_srcdir/sets.at:283: sed -n 's/.*define YYFINAL *\\([0-9][0-9]*\\)/final state \\1/p' input.c"
at_fn_check_prepare_trace "sets.at:283"
( $at_check_trace; sed -n 's/.*define YYFINAL *\([0-9][0-9]*\)/final state \1/p' input.c
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:283"
$at_failed && at_fn_log_failure
$at_traceon; }

mv stdout expout

# Get the final state in the report, from the "accept" action..
{ set +x
$as_echo "$at_srcdir/sets.at:288: sed -n '
           /^state \\(.*\\)/{
	     s//final state \\1/
	     x
	   }
	   / accept/{
	     x
	     p
	     q
	   }
	' input.output"
at_fn_check_prepare_notrace 'an embedded newline' "sets.at:288"
( $at_check_trace; sed -n '
           /^state \(.*\)/{
	     s//final state \1/
	     x
	   }
	   / accept/{
	     x
	     p
	     q
	   }
	' input.output
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:288"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_71
#AT_START_72
# 72. reduce.at:24: Useless Terminals
at_setup_line='reduce.at:24'
at_fn_banner 5
at_desc="Useless Terminals"
at_desc_line=" 72: $at_desc                              "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "72. reduce.at:24: testing ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%verbose
%output "input.c"

%token useless1
%token useless2
%token useless3
%token useless4
%token useless5
%token useless6
%token useless7
%token useless8
%token useless9

%token useful
%%
exp: useful;
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/reduce.at:45: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:45"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:45"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/reduce.at:45: bison --xml=xml-tests/test.xml input.y"
at_fn_check_prepare_trace "reduce.at:45"
( $at_check_trace; bison --xml=xml-tests/test.xml input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:45"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/reduce.at:45: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:45"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:45"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/reduce.at:45: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:45"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:45"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/reduce.at:45: bison input.y"
at_fn_check_prepare_trace "reduce.at:45"
( $at_check_trace; bison input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:45"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/reduce.at:47: sed -n '/^Grammar/q;/^\$/!p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^Grammar/q;/^$/!p' input.output" "reduce.at:47"
( $at_check_trace; sed -n '/^Grammar/q;/^$/!p' input.output
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "Terminals unused in grammar
   useless1
   useless2
   useless3
   useless4
   useless5
   useless6
   useless7
   useless8
   useless9
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:47"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_72
#AT_START_73
# 73. reduce.at:68: Useless Nonterminals
at_setup_line='reduce.at:68'
at_fn_banner 5
at_desc="Useless Nonterminals"
at_desc_line=" 73: $at_desc                           "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "73. reduce.at:68: testing ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%verbose
%output "input.c"

%nterm useless1
%nterm useless2
%nterm useless3
%nterm useless4
%nterm useless5
%nterm useless6
%nterm useless7
%nterm useless8
%nterm useless9

%token useful
%%
exp: useful;
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/reduce.at:89: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:89"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:89"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/reduce.at:89: bison --xml=xml-tests/test.xml input.y"
at_fn_check_prepare_trace "reduce.at:89"
( $at_check_trace; bison --xml=xml-tests/test.xml input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:89"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/reduce.at:89: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:89"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:89"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/reduce.at:89: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:89"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:89"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/reduce.at:89: bison input.y"
at_fn_check_prepare_trace "reduce.at:89"
( $at_check_trace; bison input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y: warning: 9 nonterminals useless in grammar
input.y:4.8-15: warning: nonterminal useless in grammar: useless1
input.y:5.8-15: warning: nonterminal useless in grammar: useless2
input.y:6.8-15: warning: nonterminal useless in grammar: useless3
input.y:7.8-15: warning: nonterminal useless in grammar: useless4
input.y:8.8-15: warning: nonterminal useless in grammar: useless5
input.y:9.8-15: warning: nonterminal useless in grammar: useless6
input.y:10.8-15: warning: nonterminal useless in grammar: useless7
input.y:11.8-15: warning: nonterminal useless in grammar: useless8
input.y:12.8-15: warning: nonterminal useless in grammar: useless9
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:89"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/reduce.at:102: sed -n '/^Grammar/q;/^\$/!p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^Grammar/q;/^$/!p' input.output" "reduce.at:102"
( $at_check_trace; sed -n '/^Grammar/q;/^$/!p' input.output
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "Nonterminals useless in grammar
   useless1
   useless2
   useless3
   useless4
   useless5
   useless6
   useless7
   useless8
   useless9
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:102"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_73
#AT_START_74
# 74. reduce.at:123: Useless Rules
at_setup_line='reduce.at:123'
at_fn_banner 5
at_desc="Useless Rules"
at_desc_line=" 74: $at_desc                                  "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "74. reduce.at:123: testing ..."
  $at_traceon




cat >input.y <<'_ATEOF'
%verbose
%output "input.c"
%token useful
%%
exp: useful;
useless1: '1';
useless2: '2';
useless3: '3';
useless4: '4';
useless5: '5';
useless6: '6';
useless7: '7';
useless8: '8';
useless9: '9';
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/reduce.at:144: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:144"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:144"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/reduce.at:144: bison --xml=xml-tests/test.xml input.y"
at_fn_check_prepare_trace "reduce.at:144"
( $at_check_trace; bison --xml=xml-tests/test.xml input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:144"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/reduce.at:144: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:144"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:144"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/reduce.at:144: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:144"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:144"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/reduce.at:144: bison input.y"
at_fn_check_prepare_trace "reduce.at:144"
( $at_check_trace; bison input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y: warning: 9 nonterminals useless in grammar
input.y: warning: 9 rules useless in grammar
input.y:6.1-8: warning: nonterminal useless in grammar: useless1
input.y:7.1-8: warning: nonterminal useless in grammar: useless2
input.y:8.1-8: warning: nonterminal useless in grammar: useless3
input.y:9.1-8: warning: nonterminal useless in grammar: useless4
input.y:10.1-8: warning: nonterminal useless in grammar: useless5
input.y:11.1-8: warning: nonterminal useless in grammar: useless6
input.y:12.1-8: warning: nonterminal useless in grammar: useless7
input.y:13.1-8: warning: nonterminal useless in grammar: useless8
input.y:14.1-8: warning: nonterminal useless in grammar: useless9
input.y:6.11-13: warning: rule useless in grammar: useless1: '1'
input.y:7.11-13: warning: rule useless in grammar: useless2: '2'
input.y:8.11-13: warning: rule useless in grammar: useless3: '3'
input.y:9.11-13: warning: rule useless in grammar: useless4: '4'
input.y:10.11-13: warning: rule useless in grammar: useless5: '5'
input.y:11.11-13: warning: rule useless in grammar: useless6: '6'
input.y:12.11-13: warning: rule useless in grammar: useless7: '7'
input.y:13.11-13: warning: rule useless in grammar: useless8: '8'
input.y:14.11-13: warning: rule useless in grammar: useless9: '9'
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:144"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/reduce.at:167: sed -n '/^Grammar/q;/^\$/!p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^Grammar/q;/^$/!p' input.output" "reduce.at:167"
( $at_check_trace; sed -n '/^Grammar/q;/^$/!p' input.output
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "Nonterminals useless in grammar
   useless1
   useless2
   useless3
   useless4
   useless5
   useless6
   useless7
   useless8
   useless9
Terminals unused in grammar
   '1'
   '2'
   '3'
   '4'
   '5'
   '6'
   '7'
   '8'
   '9'
Rules useless in grammar
    2 useless1: '1'
    3 useless2: '2'
    4 useless3: '3'
    5 useless4: '4'
    6 useless5: '5'
    7 useless6: '6'
    8 useless7: '7'
    9 useless8: '8'
   10 useless9: '9'
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:167"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_74
#AT_START_75
# 75. reduce.at:211: Reduced Automaton
at_setup_line='reduce.at:211'
at_fn_banner 5
at_desc="Reduced Automaton"
at_desc_line=" 75: $at_desc                              "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "75. reduce.at:211: testing ..."
  $at_traceon




# The non reduced grammar.
# ------------------------
cat >not-reduced.y <<'_ATEOF'
/* A useless token. */
%token useless_token
/* A useful one. */
%token useful
%verbose
%output "not-reduced.c"

%%

exp: useful            { /* A useful action. */ }
   | non_productive    { /* A non productive action. */ }
   ;

not_reachable: useful  { /* A not reachable action. */ }
             ;

non_productive: non_productive useless_token
                       { /* Another non productive action. */ }
              ;
%%
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/reduce.at:240: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot not-reduced.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:240"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot not-reduced.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:240"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/reduce.at:240: bison --xml=xml-tests/test.xml not-reduced.y"
at_fn_check_prepare_trace "reduce.at:240"
( $at_check_trace; bison --xml=xml-tests/test.xml not-reduced.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:240"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/reduce.at:240: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:240"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:240"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/reduce.at:240: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:240"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:240"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/reduce.at:240: bison not-reduced.y"
at_fn_check_prepare_trace "reduce.at:240"
( $at_check_trace; bison not-reduced.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "not-reduced.y: warning: 2 nonterminals useless in grammar
not-reduced.y: warning: 3 rules useless in grammar
not-reduced.y:14.1-13: warning: nonterminal useless in grammar: not_reachable
not-reduced.y:11.6-19: warning: nonterminal useless in grammar: non_productive
not-reduced.y:11.6-57: warning: rule useless in grammar: exp: non_productive
not-reduced.y:14.16-56: warning: rule useless in grammar: not_reachable: useful
not-reduced.y:17.17-18.63: warning: rule useless in grammar: non_productive: non_productive useless_token
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:240"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/reduce.at:250: sed -n '/^Grammar/q;/^\$/!p' not-reduced.output"
at_fn_check_prepare_dynamic "sed -n '/^Grammar/q;/^$/!p' not-reduced.output" "reduce.at:250"
( $at_check_trace; sed -n '/^Grammar/q;/^$/!p' not-reduced.output
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "Nonterminals useless in grammar
   not_reachable
   non_productive
Terminals unused in grammar
   useless_token
Rules useless in grammar
    2 exp: non_productive
    3 not_reachable: useful
    4 non_productive: non_productive useless_token
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:250"
$at_failed && at_fn_log_failure
$at_traceon; }


# The reduced grammar.
# --------------------
cat >reduced.y <<'_ATEOF'
/* A useless token. */
%token useless_token
/* A useful one. */
%token useful
%verbose
%output "reduced.c"

%%

exp: useful            { /* A useful action. */ }
//   | non_productive    { /* A non productive action. */ } */
   ;

//not_reachable: useful  { /* A not reachable action. */ }
//             ;

//non_productive: non_productive useless_token
//                       { /* Another non productive action. */ }
//              ;
%%
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/reduce.at:287: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot reduced.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:287"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot reduced.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:287"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/reduce.at:287: bison --xml=xml-tests/test.xml reduced.y"
at_fn_check_prepare_trace "reduce.at:287"
( $at_check_trace; bison --xml=xml-tests/test.xml reduced.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:287"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/reduce.at:287: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:287"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:287"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/reduce.at:287: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:287"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:287"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/reduce.at:287: bison reduced.y"
at_fn_check_prepare_trace "reduce.at:287"
( $at_check_trace; bison reduced.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:287"
$at_failed && at_fn_log_failure
$at_traceon; }


# Comparing the parsers.
cp reduced.c expout
{ set +x
$as_echo "$at_srcdir/reduce.at:291: sed 's/not-reduced/reduced/g' not-reduced.c"
at_fn_check_prepare_trace "reduce.at:291"
( $at_check_trace; sed 's/not-reduced/reduced/g' not-reduced.c
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:291"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_75
#AT_START_76
# 76. reduce.at:301: Underivable Rules
at_setup_line='reduce.at:301'
at_fn_banner 5
at_desc="Underivable Rules"
at_desc_line=" 76: $at_desc                              "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "76. reduce.at:301: testing ..."
  $at_traceon




cat >input.y <<'_ATEOF'
%verbose
%output "input.c"
%token useful
%%
exp: useful | underivable;
underivable: indirection;
indirection: underivable;
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/reduce.at:315: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:315"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:315"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/reduce.at:315: bison --xml=xml-tests/test.xml input.y"
at_fn_check_prepare_trace "reduce.at:315"
( $at_check_trace; bison --xml=xml-tests/test.xml input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:315"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/reduce.at:315: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:315"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:315"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/reduce.at:315: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:315"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:315"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/reduce.at:315: bison input.y"
at_fn_check_prepare_trace "reduce.at:315"
( $at_check_trace; bison input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y: warning: 2 nonterminals useless in grammar
input.y: warning: 3 rules useless in grammar
input.y:5.15-25: warning: nonterminal useless in grammar: underivable
input.y:6.14-24: warning: nonterminal useless in grammar: indirection
input.y:5.15-25: warning: rule useless in grammar: exp: underivable
input.y:6.14-24: warning: rule useless in grammar: underivable: indirection
input.y:7.14-24: warning: rule useless in grammar: indirection: underivable
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:315"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/reduce.at:325: sed -n '/^Grammar/q;/^\$/!p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^Grammar/q;/^$/!p' input.output" "reduce.at:325"
( $at_check_trace; sed -n '/^Grammar/q;/^$/!p' input.output
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "Nonterminals useless in grammar
   underivable
   indirection
Rules useless in grammar
    2 exp: underivable
    3 underivable: indirection
    4 indirection: underivable
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:325"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_76
#AT_START_77
# 77. reduce.at:343: Empty Language
at_setup_line='reduce.at:343'
at_fn_banner 5
at_desc="Empty Language"
at_desc_line=" 77: $at_desc                                 "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "77. reduce.at:343: testing ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%output "input.c"
%%
exp: exp;
_ATEOF



{ set +x
$as_echo "$at_srcdir/reduce.at:351: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "reduce.at:351"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y: warning: 2 nonterminals useless in grammar
input.y: warning: 2 rules useless in grammar
input.y:3.1-3: fatal error: start symbol exp does not derive any sentence
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:351"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_77
#AT_START_78
# 78. synclines.at:84: Prologue synch line
at_setup_line='synclines.at:84'
at_fn_banner 6
at_desc="Prologue synch line"
at_desc_line=" 78: $at_desc                            "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "78. synclines.at:84: testing ..."
  $at_traceon


# It seems impossible to find a generic scheme to check the location
# of an error.  Even requiring GCC is not sufficient, since for instance
# the version modified by Apple:
#
# | Reading specs from /usr/libexec/gcc/darwin/ppc/2.95.2/specs
# | Apple Computer, Inc. version gcc-934.3, based on gcc version 2.95.2
# | 19991024 (release) configure:2124: $? = 0
#
# instead of:
#
# | input.y:2: #error "2"
#
# it reports:
#
# | input.y:2: "2"
# | cpp-precomp: warning: errors during smart preprocessing, retrying in basic mode

cat >syncline.c <<'_ATEOF'
#error "1"
_ATEOF


{ set +x
$as_echo "$at_srcdir/synclines.at:84: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c syncline.c" "synclines.at:84"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c syncline.c
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/synclines.at:84"
$at_failed && at_fn_log_failure
$at_traceon; }

# In case GCC displays column information, strip it down.
#
#   input.y:4:2: #error "4"    or
#   input.y:4.2: #error "4"    or
#   input.y:4:2: error: #error "4"
# =>
#   input.y:4: #error "4"
#
{ set +x
$as_echo "$at_srcdir/synclines.at:84: sed -e 's/^\\([^:]*:[^:.]*\\)[.:][^:]*:\\(.*\\)\$/\\1:\\2/' -e 's/^\\([^:]*:[^:]*:\\)[^#]*\\( #error\\)/\\1\\2/' stderr"
at_fn_check_prepare_dynamic "sed -e 's/^\\([^:]*:[^:.]*\\)[.:][^:]*:\\(.*\\)$/\\1:\\2/' -e 's/^\\([^:]*:[^:]*:\\)[^#]*\\( #error\\)/\\1\\2/' stderr" "synclines.at:84"
( $at_check_trace; sed -e 's/^\([^:]*:[^:.]*\)[.:][^:]*:\(.*\)$/\1:\2/' -e 's/^\([^:]*:[^:]*:\)[^#]*\( #error\)/\1\2/' stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:84"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/synclines.at:84: test \"\`cat stdout\`\" = 'syncline.c:1: #error \"1\"' || exit 77"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:84"
( $at_check_trace; test "`cat stdout`" = 'syncline.c:1: #error "1"' || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:84"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input.y <<'_ATEOF'
%{
#error "2"
void yyerror (const char *s);
int yylex (void);
%}
%%
exp: '0';
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/synclines.at:84: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:84"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:84"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/synclines.at:84: bison --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_trace "synclines.at:84"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:84"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/synclines.at:84: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:84"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:84"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/synclines.at:84: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:84"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:84"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/synclines.at:84: bison -o input.c input.y"
at_fn_check_prepare_trace "synclines.at:84"
( $at_check_trace; bison -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:84"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/synclines.at:84: \$CC \$CFLAGS \$CPPFLAGS -c input.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c input.c" "synclines.at:84"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c input.c
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/synclines.at:84"
$at_failed && at_fn_log_failure
$at_traceon; }

# In case GCC displays column information, strip it down.
#
#   input.y:4:2: #error "4"    or
#   input.y:4.2: #error "4"    or
#   input.y:4:2: error: #error "4"
# =>
#   input.y:4: #error "4"
#
{ set +x
$as_echo "$at_srcdir/synclines.at:84: sed -e 's/^\\([^:]*:[^:.]*\\)[.:][^:]*:\\(.*\\)\$/\\1:\\2/' -e 's/^\\([^:]*:[^:]*:\\)[^#]*\\( #error\\)/\\1\\2/' stderr"
at_fn_check_prepare_dynamic "sed -e 's/^\\([^:]*:[^:.]*\\)[.:][^:]*:\\(.*\\)$/\\1:\\2/' -e 's/^\\([^:]*:[^:]*:\\)[^#]*\\( #error\\)/\\1\\2/' stderr" "synclines.at:84"
( $at_check_trace; sed -e 's/^\([^:]*:[^:.]*\)[.:][^:]*:\(.*\)$/\1:\2/' -e 's/^\([^:]*:[^:]*:\)[^#]*\( #error\)/\1\2/' stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:84"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/synclines.at:84: cat stdout"
at_fn_check_prepare_trace "synclines.at:84"
( $at_check_trace; cat stdout
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "input.y:2: #error \"2\"
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:84"
$at_failed && at_fn_log_failure
$at_traceon; }

  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_78
#AT_START_79
# 79. synclines.at:101: %union synch line
at_setup_line='synclines.at:101'
at_fn_banner 6
at_desc="%union synch line"
at_desc_line=" 79: $at_desc                              "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "79. synclines.at:101: testing ..."
  $at_traceon


# It seems impossible to find a generic scheme to check the location
# of an error.  Even requiring GCC is not sufficient, since for instance
# the version modified by Apple:
#
# | Reading specs from /usr/libexec/gcc/darwin/ppc/2.95.2/specs
# | Apple Computer, Inc. version gcc-934.3, based on gcc version 2.95.2
# | 19991024 (release) configure:2124: $? = 0
#
# instead of:
#
# | input.y:2: #error "2"
#
# it reports:
#
# | input.y:2: "2"
# | cpp-precomp: warning: errors during smart preprocessing, retrying in basic mode

cat >syncline.c <<'_ATEOF'
#error "1"
_ATEOF


{ set +x
$as_echo "$at_srcdir/synclines.at:101: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c syncline.c" "synclines.at:101"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c syncline.c
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/synclines.at:101"
$at_failed && at_fn_log_failure
$at_traceon; }

# In case GCC displays column information, strip it down.
#
#   input.y:4:2: #error "4"    or
#   input.y:4.2: #error "4"    or
#   input.y:4:2: error: #error "4"
# =>
#   input.y:4: #error "4"
#
{ set +x
$as_echo "$at_srcdir/synclines.at:101: sed -e 's/^\\([^:]*:[^:.]*\\)[.:][^:]*:\\(.*\\)\$/\\1:\\2/' -e 's/^\\([^:]*:[^:]*:\\)[^#]*\\( #error\\)/\\1\\2/' stderr"
at_fn_check_prepare_dynamic "sed -e 's/^\\([^:]*:[^:.]*\\)[.:][^:]*:\\(.*\\)$/\\1:\\2/' -e 's/^\\([^:]*:[^:]*:\\)[^#]*\\( #error\\)/\\1\\2/' stderr" "synclines.at:101"
( $at_check_trace; sed -e 's/^\([^:]*:[^:.]*\)[.:][^:]*:\(.*\)$/\1:\2/' -e 's/^\([^:]*:[^:]*:\)[^#]*\( #error\)/\1\2/' stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:101"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/synclines.at:101: test \"\`cat stdout\`\" = 'syncline.c:1: #error \"1\"' || exit 77"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:101"
( $at_check_trace; test "`cat stdout`" = 'syncline.c:1: #error "1"' || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:101"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input.y <<'_ATEOF'
%union {
#error "2"
  char dummy;
}
%{
void yyerror (const char *s);
int yylex (void);
%}
%%
exp: '0';
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/synclines.at:101: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:101"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:101"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/synclines.at:101: bison --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_trace "synclines.at:101"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:101"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/synclines.at:101: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:101"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:101"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/synclines.at:101: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:101"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:101"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/synclines.at:101: bison -o input.c input.y"
at_fn_check_prepare_trace "synclines.at:101"
( $at_check_trace; bison -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:101"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/synclines.at:101: \$CC \$CFLAGS \$CPPFLAGS -c input.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c input.c" "synclines.at:101"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c input.c
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/synclines.at:101"
$at_failed && at_fn_log_failure
$at_traceon; }

# In case GCC displays column information, strip it down.
#
#   input.y:4:2: #error "4"    or
#   input.y:4.2: #error "4"    or
#   input.y:4:2: error: #error "4"
# =>
#   input.y:4: #error "4"
#
{ set +x
$as_echo "$at_srcdir/synclines.at:101: sed -e 's/^\\([^:]*:[^:.]*\\)[.:][^:]*:\\(.*\\)\$/\\1:\\2/' -e 's/^\\([^:]*:[^:]*:\\)[^#]*\\( #error\\)/\\1\\2/' stderr"
at_fn_check_prepare_dynamic "sed -e 's/^\\([^:]*:[^:.]*\\)[.:][^:]*:\\(.*\\)$/\\1:\\2/' -e 's/^\\([^:]*:[^:]*:\\)[^#]*\\( #error\\)/\\1\\2/' stderr" "synclines.at:101"
( $at_check_trace; sed -e 's/^\([^:]*:[^:.]*\)[.:][^:]*:\(.*\)$/\1:\2/' -e 's/^\([^:]*:[^:]*:\)[^#]*\( #error\)/\1\2/' stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:101"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/synclines.at:101: cat stdout"
at_fn_check_prepare_trace "synclines.at:101"
( $at_check_trace; cat stdout
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "input.y:2: #error \"2\"
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:101"
$at_failed && at_fn_log_failure
$at_traceon; }

  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_79
#AT_START_80
# 80. synclines.at:121: Postprologue synch line
at_setup_line='synclines.at:121'
at_fn_banner 6
at_desc="Postprologue synch line"
at_desc_line=" 80: $at_desc                        "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "80. synclines.at:121: testing ..."
  $at_traceon


# It seems impossible to find a generic scheme to check the location
# of an error.  Even requiring GCC is not sufficient, since for instance
# the version modified by Apple:
#
# | Reading specs from /usr/libexec/gcc/darwin/ppc/2.95.2/specs
# | Apple Computer, Inc. version gcc-934.3, based on gcc version 2.95.2
# | 19991024 (release) configure:2124: $? = 0
#
# instead of:
#
# | input.y:2: #error "2"
#
# it reports:
#
# | input.y:2: "2"
# | cpp-precomp: warning: errors during smart preprocessing, retrying in basic mode

cat >syncline.c <<'_ATEOF'
#error "1"
_ATEOF


{ set +x
$as_echo "$at_srcdir/synclines.at:121: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c syncline.c" "synclines.at:121"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c syncline.c
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/synclines.at:121"
$at_failed && at_fn_log_failure
$at_traceon; }

# In case GCC displays column information, strip it down.
#
#   input.y:4:2: #error "4"    or
#   input.y:4.2: #error "4"    or
#   input.y:4:2: error: #error "4"
# =>
#   input.y:4: #error "4"
#
{ set +x
$as_echo "$at_srcdir/synclines.at:121: sed -e 's/^\\([^:]*:[^:.]*\\)[.:][^:]*:\\(.*\\)\$/\\1:\\2/' -e 's/^\\([^:]*:[^:]*:\\)[^#]*\\( #error\\)/\\1\\2/' stderr"
at_fn_check_prepare_dynamic "sed -e 's/^\\([^:]*:[^:.]*\\)[.:][^:]*:\\(.*\\)$/\\1:\\2/' -e 's/^\\([^:]*:[^:]*:\\)[^#]*\\( #error\\)/\\1\\2/' stderr" "synclines.at:121"
( $at_check_trace; sed -e 's/^\([^:]*:[^:.]*\)[.:][^:]*:\(.*\)$/\1:\2/' -e 's/^\([^:]*:[^:]*:\)[^#]*\( #error\)/\1\2/' stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:121"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/synclines.at:121: test \"\`cat stdout\`\" = 'syncline.c:1: #error \"1\"' || exit 77"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:121"
( $at_check_trace; test "`cat stdout`" = 'syncline.c:1: #error "1"' || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:121"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input.y <<'_ATEOF'
%{
void yyerror (const char *s);
int yylex (void);
%}
%union
{
  int ival;
}
%{
#error "10"
%}
%%
exp: '0';
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/synclines.at:121: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:121"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:121"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/synclines.at:121: bison --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_trace "synclines.at:121"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:121"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/synclines.at:121: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:121"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:121"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/synclines.at:121: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:121"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:121"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/synclines.at:121: bison -o input.c input.y"
at_fn_check_prepare_trace "synclines.at:121"
( $at_check_trace; bison -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:121"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/synclines.at:121: \$CC \$CFLAGS \$CPPFLAGS -c input.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c input.c" "synclines.at:121"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c input.c
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/synclines.at:121"
$at_failed && at_fn_log_failure
$at_traceon; }

# In case GCC displays column information, strip it down.
#
#   input.y:4:2: #error "4"    or
#   input.y:4.2: #error "4"    or
#   input.y:4:2: error: #error "4"
# =>
#   input.y:4: #error "4"
#
{ set +x
$as_echo "$at_srcdir/synclines.at:121: sed -e 's/^\\([^:]*:[^:.]*\\)[.:][^:]*:\\(.*\\)\$/\\1:\\2/' -e 's/^\\([^:]*:[^:]*:\\)[^#]*\\( #error\\)/\\1\\2/' stderr"
at_fn_check_prepare_dynamic "sed -e 's/^\\([^:]*:[^:.]*\\)[.:][^:]*:\\(.*\\)$/\\1:\\2/' -e 's/^\\([^:]*:[^:]*:\\)[^#]*\\( #error\\)/\\1\\2/' stderr" "synclines.at:121"
( $at_check_trace; sed -e 's/^\([^:]*:[^:.]*\)[.:][^:]*:\(.*\)$/\1:\2/' -e 's/^\([^:]*:[^:]*:\)[^#]*\( #error\)/\1\2/' stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:121"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/synclines.at:121: cat stdout"
at_fn_check_prepare_trace "synclines.at:121"
( $at_check_trace; cat stdout
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "input.y:10: #error \"10\"
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:121"
$at_failed && at_fn_log_failure
$at_traceon; }

  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_80
#AT_START_81
# 81. synclines.at:144: Action synch line
at_setup_line='synclines.at:144'
at_fn_banner 6
at_desc="Action synch line"
at_desc_line=" 81: $at_desc                              "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "81. synclines.at:144: testing ..."
  $at_traceon


# It seems impossible to find a generic scheme to check the location
# of an error.  Even requiring GCC is not sufficient, since for instance
# the version modified by Apple:
#
# | Reading specs from /usr/libexec/gcc/darwin/ppc/2.95.2/specs
# | Apple Computer, Inc. version gcc-934.3, based on gcc version 2.95.2
# | 19991024 (release) configure:2124: $? = 0
#
# instead of:
#
# | input.y:2: #error "2"
#
# it reports:
#
# | input.y:2: "2"
# | cpp-precomp: warning: errors during smart preprocessing, retrying in basic mode

cat >syncline.c <<'_ATEOF'
#error "1"
_ATEOF


{ set +x
$as_echo "$at_srcdir/synclines.at:144: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c syncline.c" "synclines.at:144"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c syncline.c
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/synclines.at:144"
$at_failed && at_fn_log_failure
$at_traceon; }

# In case GCC displays column information, strip it down.
#
#   input.y:4:2: #error "4"    or
#   input.y:4.2: #error "4"    or
#   input.y:4:2: error: #error "4"
# =>
#   input.y:4: #error "4"
#
{ set +x
$as_echo "$at_srcdir/synclines.at:144: sed -e 's/^\\([^:]*:[^:.]*\\)[.:][^:]*:\\(.*\\)\$/\\1:\\2/' -e 's/^\\([^:]*:[^:]*:\\)[^#]*\\( #error\\)/\\1\\2/' stderr"
at_fn_check_prepare_dynamic "sed -e 's/^\\([^:]*:[^:.]*\\)[.:][^:]*:\\(.*\\)$/\\1:\\2/' -e 's/^\\([^:]*:[^:]*:\\)[^#]*\\( #error\\)/\\1\\2/' stderr" "synclines.at:144"
( $at_check_trace; sed -e 's/^\([^:]*:[^:.]*\)[.:][^:]*:\(.*\)$/\1:\2/' -e 's/^\([^:]*:[^:]*:\)[^#]*\( #error\)/\1\2/' stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:144"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/synclines.at:144: test \"\`cat stdout\`\" = 'syncline.c:1: #error \"1\"' || exit 77"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:144"
( $at_check_trace; test "`cat stdout`" = 'syncline.c:1: #error "1"' || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:144"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input.y <<'_ATEOF'
%{
void yyerror (const char *s);
int yylex (void);
%}
%%
exp:
{
#error "8"
};
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/synclines.at:144: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:144"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:144"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/synclines.at:144: bison --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_trace "synclines.at:144"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:144"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/synclines.at:144: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:144"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:144"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/synclines.at:144: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:144"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:144"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/synclines.at:144: bison -o input.c input.y"
at_fn_check_prepare_trace "synclines.at:144"
( $at_check_trace; bison -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:144"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/synclines.at:144: \$CC \$CFLAGS \$CPPFLAGS -c input.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c input.c" "synclines.at:144"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c input.c
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/synclines.at:144"
$at_failed && at_fn_log_failure
$at_traceon; }

# In case GCC displays column information, strip it down.
#
#   input.y:4:2: #error "4"    or
#   input.y:4.2: #error "4"    or
#   input.y:4:2: error: #error "4"
# =>
#   input.y:4: #error "4"
#
{ set +x
$as_echo "$at_srcdir/synclines.at:144: sed -e 's/^\\([^:]*:[^:.]*\\)[.:][^:]*:\\(.*\\)\$/\\1:\\2/' -e 's/^\\([^:]*:[^:]*:\\)[^#]*\\( #error\\)/\\1\\2/' stderr"
at_fn_check_prepare_dynamic "sed -e 's/^\\([^:]*:[^:.]*\\)[.:][^:]*:\\(.*\\)$/\\1:\\2/' -e 's/^\\([^:]*:[^:]*:\\)[^#]*\\( #error\\)/\\1\\2/' stderr" "synclines.at:144"
( $at_check_trace; sed -e 's/^\([^:]*:[^:.]*\)[.:][^:]*:\(.*\)$/\1:\2/' -e 's/^\([^:]*:[^:]*:\)[^#]*\( #error\)/\1\2/' stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:144"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/synclines.at:144: cat stdout"
at_fn_check_prepare_trace "synclines.at:144"
( $at_check_trace; cat stdout
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "input.y:8: #error \"8\"
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:144"
$at_failed && at_fn_log_failure
$at_traceon; }

  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_81
#AT_START_82
# 82. synclines.at:163: Epilogue synch line
at_setup_line='synclines.at:163'
at_fn_banner 6
at_desc="Epilogue synch line"
at_desc_line=" 82: $at_desc                            "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "82. synclines.at:163: testing ..."
  $at_traceon


# It seems impossible to find a generic scheme to check the location
# of an error.  Even requiring GCC is not sufficient, since for instance
# the version modified by Apple:
#
# | Reading specs from /usr/libexec/gcc/darwin/ppc/2.95.2/specs
# | Apple Computer, Inc. version gcc-934.3, based on gcc version 2.95.2
# | 19991024 (release) configure:2124: $? = 0
#
# instead of:
#
# | input.y:2: #error "2"
#
# it reports:
#
# | input.y:2: "2"
# | cpp-precomp: warning: errors during smart preprocessing, retrying in basic mode

cat >syncline.c <<'_ATEOF'
#error "1"
_ATEOF


{ set +x
$as_echo "$at_srcdir/synclines.at:163: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c syncline.c" "synclines.at:163"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c syncline.c
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/synclines.at:163"
$at_failed && at_fn_log_failure
$at_traceon; }

# In case GCC displays column information, strip it down.
#
#   input.y:4:2: #error "4"    or
#   input.y:4.2: #error "4"    or
#   input.y:4:2: error: #error "4"
# =>
#   input.y:4: #error "4"
#
{ set +x
$as_echo "$at_srcdir/synclines.at:163: sed -e 's/^\\([^:]*:[^:.]*\\)[.:][^:]*:\\(.*\\)\$/\\1:\\2/' -e 's/^\\([^:]*:[^:]*:\\)[^#]*\\( #error\\)/\\1\\2/' stderr"
at_fn_check_prepare_dynamic "sed -e 's/^\\([^:]*:[^:.]*\\)[.:][^:]*:\\(.*\\)$/\\1:\\2/' -e 's/^\\([^:]*:[^:]*:\\)[^#]*\\( #error\\)/\\1\\2/' stderr" "synclines.at:163"
( $at_check_trace; sed -e 's/^\([^:]*:[^:.]*\)[.:][^:]*:\(.*\)$/\1:\2/' -e 's/^\([^:]*:[^:]*:\)[^#]*\( #error\)/\1\2/' stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:163"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/synclines.at:163: test \"\`cat stdout\`\" = 'syncline.c:1: #error \"1\"' || exit 77"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:163"
( $at_check_trace; test "`cat stdout`" = 'syncline.c:1: #error "1"' || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:163"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input.y <<'_ATEOF'
%{
void yyerror (const char *s);
int yylex (void);
%}
%%
exp: '0';
%%
#error "8"
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/synclines.at:163: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:163"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:163"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/synclines.at:163: bison --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_trace "synclines.at:163"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:163"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/synclines.at:163: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:163"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:163"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/synclines.at:163: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:163"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:163"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/synclines.at:163: bison -o input.c input.y"
at_fn_check_prepare_trace "synclines.at:163"
( $at_check_trace; bison -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:163"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/synclines.at:163: \$CC \$CFLAGS \$CPPFLAGS -c input.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c input.c" "synclines.at:163"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c input.c
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/synclines.at:163"
$at_failed && at_fn_log_failure
$at_traceon; }

# In case GCC displays column information, strip it down.
#
#   input.y:4:2: #error "4"    or
#   input.y:4.2: #error "4"    or
#   input.y:4:2: error: #error "4"
# =>
#   input.y:4: #error "4"
#
{ set +x
$as_echo "$at_srcdir/synclines.at:163: sed -e 's/^\\([^:]*:[^:.]*\\)[.:][^:]*:\\(.*\\)\$/\\1:\\2/' -e 's/^\\([^:]*:[^:]*:\\)[^#]*\\( #error\\)/\\1\\2/' stderr"
at_fn_check_prepare_dynamic "sed -e 's/^\\([^:]*:[^:.]*\\)[.:][^:]*:\\(.*\\)$/\\1:\\2/' -e 's/^\\([^:]*:[^:]*:\\)[^#]*\\( #error\\)/\\1\\2/' stderr" "synclines.at:163"
( $at_check_trace; sed -e 's/^\([^:]*:[^:.]*\)[.:][^:]*:\(.*\)$/\1:\2/' -e 's/^\([^:]*:[^:]*:\)[^#]*\( #error\)/\1\2/' stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:163"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/synclines.at:163: cat stdout"
at_fn_check_prepare_trace "synclines.at:163"
( $at_check_trace; cat stdout
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "input.y:8: #error \"8\"
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:163"
$at_failed && at_fn_log_failure
$at_traceon; }

  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_82
#AT_START_83
# 83. headers.at:26: %union and --defines
at_setup_line='headers.at:26'
at_fn_banner 7
at_desc="%union and --defines"
at_desc_line=" 83: $at_desc                           "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "83. headers.at:26: testing ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%union
{
  int   integer;
  char *string ;
}
%%
exp: {};
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/headers.at:38: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot --defines input.y"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:38"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot --defines input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:38"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/headers.at:38: bison --xml=xml-tests/test.xml --defines input.y"
at_fn_check_prepare_trace "headers.at:38"
( $at_check_trace; bison --xml=xml-tests/test.xml --defines input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:38"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/headers.at:38: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:38"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:38"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/headers.at:38: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:38"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:38"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/headers.at:38: bison --defines input.y"
at_fn_check_prepare_trace "headers.at:38"
( $at_check_trace; bison --defines input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:38"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_83
#AT_START_84
# 84. headers.at:76: Invalid CPP guards: input/input
at_setup_line='headers.at:76'
at_fn_banner 7
at_desc="Invalid CPP guards: input/input"
at_desc_line=" 84: $at_desc                "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "84. headers.at:76: testing ..."
  $at_traceon


# Possibly create inner directories.
dirname=`$as_dirname -- input/input ||
$as_expr Xinput/input : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
	 Xinput/input : 'X\(//\)[^/]' \| \
	 Xinput/input : 'X\(//\)$' \| \
	 Xinput/input : 'X\(/\)' \| . 2>/dev/null ||
$as_echo Xinput/input |
    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)[^/].*/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\).*/{
	    s//\1/
	    q
	  }
	  s/.*/./; q'`
as_dir=$dirname; as_fn_mkdir_p

cat >input/input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%{
#include <input/input.h>
void yyerror (const char *);
int yylex (void);
%}
%%
dummy:;
%%
#include <input/input.h>
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/headers.at:76: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot --defines=input/input.h --output=y.tab.c input/input.y"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:76"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot --defines=input/input.h --output=y.tab.c input/input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:76"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/headers.at:76: bison --xml=xml-tests/test.xml --defines=input/input.h --output=y.tab.c input/input.y"
at_fn_check_prepare_trace "headers.at:76"
( $at_check_trace; bison --xml=xml-tests/test.xml --defines=input/input.h --output=y.tab.c input/input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:76"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/headers.at:76: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:76"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:76"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/headers.at:76: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:76"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:76"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/headers.at:76: bison --defines=input/input.h --output=y.tab.c input/input.y"
at_fn_check_prepare_trace "headers.at:76"
( $at_check_trace; bison --defines=input/input.h --output=y.tab.c input/input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:76"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/headers.at:76: \$CC \$CFLAGS \$CPPFLAGS -o y.tab.o -I. -c y.tab.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -o y.tab.o -I. -c y.tab.c" "headers.at:76"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -o y.tab.o -I. -c y.tab.c
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:76"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_84
#AT_START_85
# 85. headers.at:77: Invalid CPP guards: 9foo
at_setup_line='headers.at:77'
at_fn_banner 7
at_desc="Invalid CPP guards: 9foo"
at_desc_line=" 85: $at_desc                       "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "85. headers.at:77: testing ..."
  $at_traceon


# Possibly create inner directories.
dirname=`$as_dirname -- 9foo ||
$as_expr X9foo : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
	 X9foo : 'X\(//\)[^/]' \| \
	 X9foo : 'X\(//\)$' \| \
	 X9foo : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X9foo |
    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)[^/].*/{
	    s//\1/
	    q
	  }
	  /^X\(\/\/\)$/{
	    s//\1/
	    q
	  }
	  /^X\(\/\).*/{
	    s//\1/
	    q
	  }
	  s/.*/./; q'`
as_dir=$dirname; as_fn_mkdir_p

cat >9foo.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%{
#include <9foo.h>
void yyerror (const char *);
int yylex (void);
%}
%%
dummy:;
%%
#include <9foo.h>
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/headers.at:77: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot --defines=9foo.h --output=y.tab.c 9foo.y"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:77"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot --defines=9foo.h --output=y.tab.c 9foo.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:77"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/headers.at:77: bison --xml=xml-tests/test.xml --defines=9foo.h --output=y.tab.c 9foo.y"
at_fn_check_prepare_trace "headers.at:77"
( $at_check_trace; bison --xml=xml-tests/test.xml --defines=9foo.h --output=y.tab.c 9foo.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:77"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/headers.at:77: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:77"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:77"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/headers.at:77: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:77"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:77"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/headers.at:77: bison --defines=9foo.h --output=y.tab.c 9foo.y"
at_fn_check_prepare_trace "headers.at:77"
( $at_check_trace; bison --defines=9foo.h --output=y.tab.c 9foo.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:77"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/headers.at:77: \$CC \$CFLAGS \$CPPFLAGS -o y.tab.o -I. -c y.tab.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -o y.tab.o -I. -c y.tab.c" "headers.at:77"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -o y.tab.o -I. -c y.tab.c
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:77"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_85
#AT_START_86
# 86. headers.at:86: export YYLTYPE
at_setup_line='headers.at:86'
at_fn_banner 7
at_desc="export YYLTYPE"
at_desc_line=" 86: $at_desc                                 "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "86. headers.at:86: testing ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%locations

%name-prefix "my_"
%{
#include <stdio.h>
#include <stdlib.h>

static int
my_lex (void)
{
  return EOF;
}

static void
my_error (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}

%}
%%
exp:;
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/headers.at:113: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot --defines -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:113"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot --defines -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:113"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/headers.at:113: bison --xml=xml-tests/test.xml --defines -o input.c input.y"
at_fn_check_prepare_trace "headers.at:113"
( $at_check_trace; bison --xml=xml-tests/test.xml --defines -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:113"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/headers.at:113: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:113"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:113"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/headers.at:113: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:113"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:113"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/headers.at:113: bison --defines -o input.c input.y"
at_fn_check_prepare_trace "headers.at:113"
( $at_check_trace; bison --defines -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:113"
$at_failed && at_fn_log_failure
$at_traceon; }


# YYLTYPE should be defined, and MY_LLOC declared.
cat >caller.c <<'_ATEOF'
#include "input.h"
YYLTYPE *my_llocp = &my_lloc;

int my_parse (void);

int
main (void)
{
  return my_parse ();
}
_ATEOF


# Link and execute, just to make sure everything is fine (and in
# particular, that MY_LLOC is indeed defined somewhere).
{ set +x
$as_echo "$at_srcdir/headers.at:131: \$CC \$CFLAGS \$CPPFLAGS -o caller.o -c caller.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -o caller.o -c caller.c" "headers.at:131"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -o caller.o -c caller.c
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:131"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/headers.at:132: \$CC \$CFLAGS \$CPPFLAGS -o input.o -c input.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -o input.o -c input.c" "headers.at:132"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -o input.o -c input.c
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:132"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/headers.at:133: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o caller caller.o input.o \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o caller caller.o input.o $LIBS" "headers.at:133"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o caller caller.o input.o $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:133"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/headers.at:134:  \$PREPARSER ./caller"
at_fn_check_prepare_dynamic " $PREPARSER ./caller" "headers.at:134"
( $at_check_trace;  $PREPARSER ./caller
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:134"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_86
#AT_START_87
# 87. actions.at:23: Mid-rule actions
at_setup_line='actions.at:23'
at_fn_banner 8
at_desc="Mid-rule actions"
at_desc_line=" 87: $at_desc                               "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "87. actions.at:23: testing ..."
  $at_traceon


# Bison once forgot the mid-rule actions.  It was because the action
# was attached to the host rule (the one with the mid-rule action),
# instead of being attached to the empty rule dedicated to this
# action.

cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%error-verbose
%debug
%{
# include <stdio.h>
# include <stdlib.h>
  static void yyerror (const char *msg);
  static int yylex (void);
%}
%%
exp:     { putchar ('0'); }
     '1' { putchar ('1'); }
     '2' { putchar ('2'); }
     '3' { putchar ('3'); }
     '4' { putchar ('4'); }
     '5' { putchar ('5'); }
     '6' { putchar ('6'); }
     '7' { putchar ('7'); }
     '8' { putchar ('8'); }
     '9' { putchar ('9'); }
         { putchar ('\n'); }
   ;
%%
static int
yylex (void)
{
  static char const input[] = "123456789";
  static size_t toknum;
  if (! (toknum < sizeof input))
    abort ();
  return input[toknum++];
}

static void
yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}

int
main (void)
{
  return yyparse ();
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/actions.at:76: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -d -v -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:76"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -d -v -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:76"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:76: bison --xml=xml-tests/test.xml -d -v -o input.c input.y"
at_fn_check_prepare_trace "actions.at:76"
( $at_check_trace; bison --xml=xml-tests/test.xml -d -v -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:76"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:76: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:76"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:76"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/actions.at:76: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:76"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:76"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/actions.at:76: bison -d -v -o input.c input.y"
at_fn_check_prepare_trace "actions.at:76"
( $at_check_trace; bison -d -v -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:76"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:77: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:77"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:77"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:78:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:78"
( $at_check_trace;  $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "0123456789
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:78"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_87
#AT_START_88
# 88. actions.at:92: Exotic Dollars
at_setup_line='actions.at:92'
at_fn_banner 8
at_desc="Exotic Dollars"
at_desc_line=" 88: $at_desc                                 "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "88. actions.at:92: testing ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%error-verbose
%debug
%{
# include <stdio.h>
# include <stdlib.h>
  static void yyerror (const char *msg);
  static int yylex (void);
# define USE(Var)
%}

%union
{
  int val;
};

%type <val> a_1 a_2 a_5
            sum_of_the_five_previous_values

%%
exp: a_1 a_2 { $<val>$ = 3; } { $<val>$ = $<val>3 + 1; } a_5
     sum_of_the_five_previous_values
    {
       USE (($1, $2, $<foo>3, $<foo>4, $5));
       printf ("%d\n", $6);
    }
;
a_1: { $$ = 1; };
a_2: { $$ = 2; };
a_5: { $$ = 5; };

sum_of_the_five_previous_values:
    {
       $$ = $<val>0 + $<val>-1 + $<val>-2 + $<val>-3 + $<val>-4;
    }
;

%%
static int
yylex (void)
{
  static int called;
  if (called++)
    abort ();
  return EOF;
}

static void
yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}

int
main (void)
{
  return yyparse ();
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/actions.at:154: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -d -v -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:154"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -d -v -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:154"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:154: bison --xml=xml-tests/test.xml -d -v -o input.c input.y"
at_fn_check_prepare_trace "actions.at:154"
( $at_check_trace; bison --xml=xml-tests/test.xml -d -v -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:154"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:154: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:154"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:154"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/actions.at:154: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:154"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:154"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/actions.at:154: bison -d -v -o input.c input.y"
at_fn_check_prepare_trace "actions.at:154"
( $at_check_trace; bison -d -v -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:154"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:155: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:155"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:155"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:156:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:156"
( $at_check_trace;  $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "15
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:156"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_88
#AT_START_89
# 89. actions.at:573: Printers and Destructors :
at_setup_line='actions.at:573'
at_fn_banner 8
at_desc="Printers and Destructors : "
at_desc_line=" 89: $at_desc                    "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "89. actions.at:573: testing ..."
  $at_traceon



# Make sure complex $n work.

# Be sure to pass all the %directives to this macro to have correct
# helping macros.  So don't put any directly in the Bison file.





# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.











cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code requires {
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>

#define YYINITDEPTH 10
#define YYMAXDEPTH 10
#define RANGE(Location) (Location).first_line, (Location).last_line
}

%error-verbose
%debug
%verbose
%locations



%code {

static int yylex (void);
static void yyerror (const char *msg);
}



/* FIXME: This %printer isn't actually tested.  */
%printer
  {
    fprintf (yyoutput, "%d", $$);
  }
  input line thing 'x' 'y'

%destructor
  { printf ("Freeing nterm input (%d@%d-%d)\n", $$, RANGE (@$)); }
  input

%destructor
  { printf ("Freeing nterm line (%d@%d-%d)\n", $$, RANGE (@$)); }
  line

%destructor
  { printf ("Freeing nterm thing (%d@%d-%d)\n", $$, RANGE (@$)); }
  thing

%destructor
  { printf ("Freeing token 'x' (%d@%d-%d)\n", $$, RANGE (@$)); }
  'x'

%destructor
  { printf ("Freeing token 'y' (%d@%d-%d)\n", $$, RANGE (@$)); }
  'y'

%token END 0
%destructor
  { printf ("Freeing token END (%d@%d-%d)\n", $$, RANGE (@$)); }
  END

%%
/*
   This grammar is made to exercise error recovery.
   "Lines" starting with `(' support error recovery, with
   ')' as synchronizing token.  Lines starting with 'x' can never
   be recovered from if in error.
*/

input:
  /* Nothing. */
    {
      $$ = 0;
      printf ("input (%d@%d-%d): /* Nothing */\n", $$, RANGE (@$));
    }
| line input /* Right recursive to load the stack so that popping at
		END can	be exercised.  */
    {
      $$ = 2;
      printf ("input (%d@%d-%d): line (%d@%d-%d) input (%d@%d-%d)\n",
	      $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2));
    }
;

line:
  thing thing thing ';'
    {
      $$ = $1;
      printf ("line (%d@%d-%d): thing (%d@%d-%d) thing (%d@%d-%d) thing (%d@%d-%d) ';' (%d@%d-%d)\n",
              $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2),
              $3, RANGE (@3), $4, RANGE (@4));
    }
| '(' thing thing ')'
    {
      $$ = $1;
      printf ("line (%d@%d-%d): '(' (%d@%d-%d) thing (%d@%d-%d) thing (%d@%d-%d) ')' (%d@%d-%d)\n",
              $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2),
              $3, RANGE (@3), $4, RANGE (@4));
    }
| '(' thing ')'
    {
      $$ = $1;
      printf ("line (%d@%d-%d): '(' (%d@%d-%d) thing (%d@%d-%d) ')' (%d@%d-%d)\n",
              $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2), $3, RANGE (@3));
    }
| '(' error ')'
    {
      $$ = -1;
      printf ("line (%d@%d-%d): '(' (%d@%d-%d) error (@%d-%d) ')' (%d@%d-%d)\n",
              $$, RANGE (@$), $1, RANGE (@1), RANGE (@2), $3, RANGE (@3));
    }
;

thing:
  'x'
    {
      $$ = $1;
      printf ("thing (%d@%d-%d): 'x' (%d@%d-%d)\n",
              $$, RANGE (@$), $1, RANGE (@1));
    }
;
%%
/* Alias to ARGV[1]. */
const char *source = 0;

static int
yylex (void)
{
  static unsigned int counter = 0;

  int c = (yylval) = counter++;
  /* As in BASIC, line numbers go from 10 to 10.  */
 (yylloc).first_line = (yylloc).first_column = 10 * c;
  (yylloc).last_line = (yylloc).last_column = (yylloc).first_line + 9;


  if (! (0 <= c && c <= strlen (source)))
    abort ();
  if (source[c])
    printf ("sending: '%c'", source[c]);
  else
    printf ("sending: END");
  printf (" (%d@%d-%d)\n", c, RANGE ((yylloc)));
  return source[c];
}

static void
yyerror (const char *msg)
{
  printf ("%d-%d: %s\n", RANGE (yylloc), msg);
}

int
main (int argc, const char *argv[])
{
  int status;
  yydebug = !!getenv ("YYDEBUG");
  assert (argc == 2);
  source = argv[1];
  status = yyparse ();
  switch (status)
    {
      case 0: printf ("Successful parse.\n"); break;
      case 1: printf ("Parsing FAILED.\n"); break;
      default: printf ("Parsing FAILED (status %d).\n", status); break;
    }
  return status;
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/actions.at:573: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:573"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:573"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:573: bison --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_trace "actions.at:573"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:573"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:573: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:573"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:573"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/actions.at:573: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:573"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:573"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/actions.at:573: bison -o input.c input.y"
at_fn_check_prepare_trace "actions.at:573"
( $at_check_trace; bison -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:573"
$at_failed && at_fn_log_failure
$at_traceon; }

   { set +x
$as_echo "$at_srcdir/actions.at:573: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:573"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:573"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check the location of "empty"
# -----------------------------
# I.e., epsilon-reductions, as in "(x)" which ends by reducing
# an empty "line" nterm.
# FIXME: This location is not satisfying.  Depend on the lookahead?
{ set +x
$as_echo "$at_srcdir/actions.at:573:  \$PREPARSER ./input '(x)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:573"
( $at_check_trace;  $PREPARSER ./input '(x)'
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: ')' (2@20-29)
line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
sending: END (3@30-39)
input (0@29-29): /* Nothing */
input (2@0-29): line (0@0-29) input (0@29-29)
Freeing token END (3@30-39)
Freeing nterm input (2@0-29)
Successful parse.
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:573"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check locations in error recovery
# ---------------------------------
# '(y)' is an error, but can be recovered from.  But what's the location
# of the error itself ('y'), and of the resulting reduction ('(error)').
{ set +x
$as_echo "$at_srcdir/actions.at:573:  \$PREPARSER ./input '(y)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:573"
( $at_check_trace;  $PREPARSER ./input '(y)'
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "sending: '(' (0@0-9)
sending: 'y' (1@10-19)
10-19: syntax error, unexpected 'y', expecting 'x'
Freeing token 'y' (1@10-19)
sending: ')' (2@20-29)
line (-1@0-29): '(' (0@0-9) error (@10-19) ')' (2@20-29)
sending: END (3@30-39)
input (0@29-29): /* Nothing */
input (2@0-29): line (-1@0-29) input (0@29-29)
Freeing token END (3@30-39)
Freeing nterm input (2@0-29)
Successful parse.
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:573"
$at_failed && at_fn_log_failure
$at_traceon; }



# Syntax errors caught by the parser
# ----------------------------------
# Exercise the discarding of stack top and input until `error'
# can be reduced.
#
#     '(', 'x', 'x', 'x', 'x', 'x', ')',
#
# Load the stack and provoke an error that cannot be caught by the
# grammar, to check that the stack is cleared.  And make sure the
# lookahead is freed.
#
#     '(', 'x', ')',
#     '(', 'x', ')',
#     'y'
{ set +x
$as_echo "$at_srcdir/actions.at:573:  \$PREPARSER ./input '(xxxxx)(x)(x)y'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:573"
( $at_check_trace;  $PREPARSER ./input '(xxxxx)(x)(x)y'
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: 'x' (2@20-29)
thing (2@20-29): 'x' (2@20-29)
sending: 'x' (3@30-39)
30-39: syntax error, unexpected 'x', expecting ')'
Freeing nterm thing (2@20-29)
Freeing nterm thing (1@10-19)
Freeing token 'x' (3@30-39)
sending: 'x' (4@40-49)
Freeing token 'x' (4@40-49)
sending: 'x' (5@50-59)
Freeing token 'x' (5@50-59)
sending: ')' (6@60-69)
line (-1@0-69): '(' (0@0-9) error (@10-59) ')' (6@60-69)
sending: '(' (7@70-79)
sending: 'x' (8@80-89)
thing (8@80-89): 'x' (8@80-89)
sending: ')' (9@90-99)
line (7@70-99): '(' (7@70-79) thing (8@80-89) ')' (9@90-99)
sending: '(' (10@100-109)
sending: 'x' (11@110-119)
thing (11@110-119): 'x' (11@110-119)
sending: ')' (12@120-129)
line (10@100-129): '(' (10@100-109) thing (11@110-119) ')' (12@120-129)
sending: 'y' (13@130-139)
input (0@129-129): /* Nothing */
input (2@100-129): line (10@100-129) input (0@129-129)
input (2@70-129): line (7@70-99) input (2@100-129)
input (2@0-129): line (-1@0-69) input (2@70-129)
130-139: syntax error, unexpected 'y', expecting END
Freeing nterm input (2@0-129)
Freeing token 'y' (13@130-139)
Parsing FAILED.
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:573"
$at_failed && at_fn_log_failure
$at_traceon; }



# Syntax error caught by the parser where lookahead = END
# --------------------------------------------------------
# Load the stack and provoke an error that cannot be caught by the
# grammar, to check that the stack is cleared.  And make sure the
# lookahead is freed.
#
#     '(', 'x', ')',
#     '(', 'x', ')',
#     'x'
{ set +x
$as_echo "$at_srcdir/actions.at:573:  \$PREPARSER ./input '(x)(x)x'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:573"
( $at_check_trace;  $PREPARSER ./input '(x)(x)x'
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: ')' (2@20-29)
line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
sending: '(' (3@30-39)
sending: 'x' (4@40-49)
thing (4@40-49): 'x' (4@40-49)
sending: ')' (5@50-59)
line (3@30-59): '(' (3@30-39) thing (4@40-49) ')' (5@50-59)
sending: 'x' (6@60-69)
thing (6@60-69): 'x' (6@60-69)
sending: END (7@70-79)
70-79: syntax error, unexpected END, expecting 'x'
Freeing nterm thing (6@60-69)
Freeing nterm line (3@30-59)
Freeing nterm line (0@0-29)
Freeing token END (7@70-79)
Parsing FAILED.
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:573"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check destruction upon stack overflow
# -------------------------------------
# Upon stack overflow, all symbols on the stack should be destroyed.
# Only check for yacc.c.

{ set +x
$as_echo "$at_srcdir/actions.at:573:  \$PREPARSER ./input '(x)(x)(x)(x)(x)(x)(x)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)(x)(x)(x)(x)(x)'" "actions.at:573"
( $at_check_trace;  $PREPARSER ./input '(x)(x)(x)(x)(x)(x)(x)'
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: ')' (2@20-29)
line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
sending: '(' (3@30-39)
sending: 'x' (4@40-49)
thing (4@40-49): 'x' (4@40-49)
sending: ')' (5@50-59)
line (3@30-59): '(' (3@30-39) thing (4@40-49) ')' (5@50-59)
sending: '(' (6@60-69)
sending: 'x' (7@70-79)
thing (7@70-79): 'x' (7@70-79)
sending: ')' (8@80-89)
line (6@60-89): '(' (6@60-69) thing (7@70-79) ')' (8@80-89)
sending: '(' (9@90-99)
sending: 'x' (10@100-109)
thing (10@100-109): 'x' (10@100-109)
sending: ')' (11@110-119)
line (9@90-119): '(' (9@90-99) thing (10@100-109) ')' (11@110-119)
sending: '(' (12@120-129)
sending: 'x' (13@130-139)
thing (13@130-139): 'x' (13@130-139)
sending: ')' (14@140-149)
line (12@120-149): '(' (12@120-129) thing (13@130-139) ')' (14@140-149)
sending: '(' (15@150-159)
sending: 'x' (16@160-169)
thing (16@160-169): 'x' (16@160-169)
sending: ')' (17@170-179)
line (15@150-179): '(' (15@150-159) thing (16@160-169) ')' (17@170-179)
sending: '(' (18@180-189)
sending: 'x' (19@190-199)
thing (19@190-199): 'x' (19@190-199)
sending: ')' (20@200-209)
200-209: memory exhausted
Freeing nterm thing (19@190-199)
Freeing nterm line (15@150-179)
Freeing nterm line (12@120-149)
Freeing nterm line (9@90-119)
Freeing nterm line (6@60-89)
Freeing nterm line (3@30-59)
Freeing nterm line (0@0-29)
Parsing FAILED (status 2).
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/actions.at:573"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_89
#AT_START_90
# 90. actions.at:574: Printers and Destructors with union:
at_setup_line='actions.at:574'
at_fn_banner 8
at_desc="Printers and Destructors with union: "
at_desc_line=" 90: $at_desc          "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "90. actions.at:574: testing ..."
  $at_traceon



# Make sure complex $n work.

# Be sure to pass all the %directives to this macro to have correct
# helping macros.  So don't put any directly in the Bison file.





# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.











cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code requires {
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>

#define YYINITDEPTH 10
#define YYMAXDEPTH 10
#define RANGE(Location) (Location).first_line, (Location).last_line
}

%error-verbose
%debug
%verbose
%locations

%union
{
  int ival;
}

%code provides {

static int yylex (void);
static void yyerror (const char *msg);
}

%type <ival> '(' 'x' 'y' ')' ';' thing line input END

/* FIXME: This %printer isn't actually tested.  */
%printer
  {
    fprintf (yyoutput, "%d", $$);
  }
  input line thing 'x' 'y'

%destructor
  { printf ("Freeing nterm input (%d@%d-%d)\n", $$, RANGE (@$)); }
  input

%destructor
  { printf ("Freeing nterm line (%d@%d-%d)\n", $$, RANGE (@$)); }
  line

%destructor
  { printf ("Freeing nterm thing (%d@%d-%d)\n", $$, RANGE (@$)); }
  thing

%destructor
  { printf ("Freeing token 'x' (%d@%d-%d)\n", $$, RANGE (@$)); }
  'x'

%destructor
  { printf ("Freeing token 'y' (%d@%d-%d)\n", $$, RANGE (@$)); }
  'y'

%token END 0
%destructor
  { printf ("Freeing token END (%d@%d-%d)\n", $$, RANGE (@$)); }
  END

%%
/*
   This grammar is made to exercise error recovery.
   "Lines" starting with `(' support error recovery, with
   ')' as synchronizing token.  Lines starting with 'x' can never
   be recovered from if in error.
*/

input:
  /* Nothing. */
    {
      $$ = 0;
      printf ("input (%d@%d-%d): /* Nothing */\n", $$, RANGE (@$));
    }
| line input /* Right recursive to load the stack so that popping at
		END can	be exercised.  */
    {
      $$ = 2;
      printf ("input (%d@%d-%d): line (%d@%d-%d) input (%d@%d-%d)\n",
	      $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2));
    }
;

line:
  thing thing thing ';'
    {
      $$ = $1;
      printf ("line (%d@%d-%d): thing (%d@%d-%d) thing (%d@%d-%d) thing (%d@%d-%d) ';' (%d@%d-%d)\n",
              $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2),
              $3, RANGE (@3), $4, RANGE (@4));
    }
| '(' thing thing ')'
    {
      $$ = $1;
      printf ("line (%d@%d-%d): '(' (%d@%d-%d) thing (%d@%d-%d) thing (%d@%d-%d) ')' (%d@%d-%d)\n",
              $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2),
              $3, RANGE (@3), $4, RANGE (@4));
    }
| '(' thing ')'
    {
      $$ = $1;
      printf ("line (%d@%d-%d): '(' (%d@%d-%d) thing (%d@%d-%d) ')' (%d@%d-%d)\n",
              $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2), $3, RANGE (@3));
    }
| '(' error ')'
    {
      $$ = -1;
      printf ("line (%d@%d-%d): '(' (%d@%d-%d) error (@%d-%d) ')' (%d@%d-%d)\n",
              $$, RANGE (@$), $1, RANGE (@1), RANGE (@2), $3, RANGE (@3));
    }
;

thing:
  'x'
    {
      $$ = $1;
      printf ("thing (%d@%d-%d): 'x' (%d@%d-%d)\n",
              $$, RANGE (@$), $1, RANGE (@1));
    }
;
%%
/* Alias to ARGV[1]. */
const char *source = 0;

static int
yylex (void)
{
  static unsigned int counter = 0;

  int c = (yylval).ival = counter++;
  /* As in BASIC, line numbers go from 10 to 10.  */
 (yylloc).first_line = (yylloc).first_column = 10 * c;
  (yylloc).last_line = (yylloc).last_column = (yylloc).first_line + 9;


  if (! (0 <= c && c <= strlen (source)))
    abort ();
  if (source[c])
    printf ("sending: '%c'", source[c]);
  else
    printf ("sending: END");
  printf (" (%d@%d-%d)\n", c, RANGE ((yylloc)));
  return source[c];
}

static void
yyerror (const char *msg)
{
  printf ("%d-%d: %s\n", RANGE (yylloc), msg);
}

int
main (int argc, const char *argv[])
{
  int status;
  yydebug = !!getenv ("YYDEBUG");
  assert (argc == 2);
  source = argv[1];
  status = yyparse ();
  switch (status)
    {
      case 0: printf ("Successful parse.\n"); break;
      case 1: printf ("Parsing FAILED.\n"); break;
      default: printf ("Parsing FAILED (status %d).\n", status); break;
    }
  return status;
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/actions.at:574: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:574"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:574"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:574: bison --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_trace "actions.at:574"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:574"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:574: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:574"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:574"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/actions.at:574: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:574"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:574"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/actions.at:574: bison -o input.c input.y"
at_fn_check_prepare_trace "actions.at:574"
( $at_check_trace; bison -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:574"
$at_failed && at_fn_log_failure
$at_traceon; }

   { set +x
$as_echo "$at_srcdir/actions.at:574: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:574"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:574"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check the location of "empty"
# -----------------------------
# I.e., epsilon-reductions, as in "(x)" which ends by reducing
# an empty "line" nterm.
# FIXME: This location is not satisfying.  Depend on the lookahead?
{ set +x
$as_echo "$at_srcdir/actions.at:574:  \$PREPARSER ./input '(x)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:574"
( $at_check_trace;  $PREPARSER ./input '(x)'
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: ')' (2@20-29)
line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
sending: END (3@30-39)
input (0@29-29): /* Nothing */
input (2@0-29): line (0@0-29) input (0@29-29)
Freeing token END (3@30-39)
Freeing nterm input (2@0-29)
Successful parse.
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:574"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check locations in error recovery
# ---------------------------------
# '(y)' is an error, but can be recovered from.  But what's the location
# of the error itself ('y'), and of the resulting reduction ('(error)').
{ set +x
$as_echo "$at_srcdir/actions.at:574:  \$PREPARSER ./input '(y)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:574"
( $at_check_trace;  $PREPARSER ./input '(y)'
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "sending: '(' (0@0-9)
sending: 'y' (1@10-19)
10-19: syntax error, unexpected 'y', expecting 'x'
Freeing token 'y' (1@10-19)
sending: ')' (2@20-29)
line (-1@0-29): '(' (0@0-9) error (@10-19) ')' (2@20-29)
sending: END (3@30-39)
input (0@29-29): /* Nothing */
input (2@0-29): line (-1@0-29) input (0@29-29)
Freeing token END (3@30-39)
Freeing nterm input (2@0-29)
Successful parse.
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:574"
$at_failed && at_fn_log_failure
$at_traceon; }



# Syntax errors caught by the parser
# ----------------------------------
# Exercise the discarding of stack top and input until `error'
# can be reduced.
#
#     '(', 'x', 'x', 'x', 'x', 'x', ')',
#
# Load the stack and provoke an error that cannot be caught by the
# grammar, to check that the stack is cleared.  And make sure the
# lookahead is freed.
#
#     '(', 'x', ')',
#     '(', 'x', ')',
#     'y'
{ set +x
$as_echo "$at_srcdir/actions.at:574:  \$PREPARSER ./input '(xxxxx)(x)(x)y'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:574"
( $at_check_trace;  $PREPARSER ./input '(xxxxx)(x)(x)y'
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: 'x' (2@20-29)
thing (2@20-29): 'x' (2@20-29)
sending: 'x' (3@30-39)
30-39: syntax error, unexpected 'x', expecting ')'
Freeing nterm thing (2@20-29)
Freeing nterm thing (1@10-19)
Freeing token 'x' (3@30-39)
sending: 'x' (4@40-49)
Freeing token 'x' (4@40-49)
sending: 'x' (5@50-59)
Freeing token 'x' (5@50-59)
sending: ')' (6@60-69)
line (-1@0-69): '(' (0@0-9) error (@10-59) ')' (6@60-69)
sending: '(' (7@70-79)
sending: 'x' (8@80-89)
thing (8@80-89): 'x' (8@80-89)
sending: ')' (9@90-99)
line (7@70-99): '(' (7@70-79) thing (8@80-89) ')' (9@90-99)
sending: '(' (10@100-109)
sending: 'x' (11@110-119)
thing (11@110-119): 'x' (11@110-119)
sending: ')' (12@120-129)
line (10@100-129): '(' (10@100-109) thing (11@110-119) ')' (12@120-129)
sending: 'y' (13@130-139)
input (0@129-129): /* Nothing */
input (2@100-129): line (10@100-129) input (0@129-129)
input (2@70-129): line (7@70-99) input (2@100-129)
input (2@0-129): line (-1@0-69) input (2@70-129)
130-139: syntax error, unexpected 'y', expecting END
Freeing nterm input (2@0-129)
Freeing token 'y' (13@130-139)
Parsing FAILED.
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:574"
$at_failed && at_fn_log_failure
$at_traceon; }



# Syntax error caught by the parser where lookahead = END
# --------------------------------------------------------
# Load the stack and provoke an error that cannot be caught by the
# grammar, to check that the stack is cleared.  And make sure the
# lookahead is freed.
#
#     '(', 'x', ')',
#     '(', 'x', ')',
#     'x'
{ set +x
$as_echo "$at_srcdir/actions.at:574:  \$PREPARSER ./input '(x)(x)x'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:574"
( $at_check_trace;  $PREPARSER ./input '(x)(x)x'
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: ')' (2@20-29)
line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
sending: '(' (3@30-39)
sending: 'x' (4@40-49)
thing (4@40-49): 'x' (4@40-49)
sending: ')' (5@50-59)
line (3@30-59): '(' (3@30-39) thing (4@40-49) ')' (5@50-59)
sending: 'x' (6@60-69)
thing (6@60-69): 'x' (6@60-69)
sending: END (7@70-79)
70-79: syntax error, unexpected END, expecting 'x'
Freeing nterm thing (6@60-69)
Freeing nterm line (3@30-59)
Freeing nterm line (0@0-29)
Freeing token END (7@70-79)
Parsing FAILED.
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:574"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check destruction upon stack overflow
# -------------------------------------
# Upon stack overflow, all symbols on the stack should be destroyed.
# Only check for yacc.c.

{ set +x
$as_echo "$at_srcdir/actions.at:574:  \$PREPARSER ./input '(x)(x)(x)(x)(x)(x)(x)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)(x)(x)(x)(x)(x)'" "actions.at:574"
( $at_check_trace;  $PREPARSER ./input '(x)(x)(x)(x)(x)(x)(x)'
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: ')' (2@20-29)
line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
sending: '(' (3@30-39)
sending: 'x' (4@40-49)
thing (4@40-49): 'x' (4@40-49)
sending: ')' (5@50-59)
line (3@30-59): '(' (3@30-39) thing (4@40-49) ')' (5@50-59)
sending: '(' (6@60-69)
sending: 'x' (7@70-79)
thing (7@70-79): 'x' (7@70-79)
sending: ')' (8@80-89)
line (6@60-89): '(' (6@60-69) thing (7@70-79) ')' (8@80-89)
sending: '(' (9@90-99)
sending: 'x' (10@100-109)
thing (10@100-109): 'x' (10@100-109)
sending: ')' (11@110-119)
line (9@90-119): '(' (9@90-99) thing (10@100-109) ')' (11@110-119)
sending: '(' (12@120-129)
sending: 'x' (13@130-139)
thing (13@130-139): 'x' (13@130-139)
sending: ')' (14@140-149)
line (12@120-149): '(' (12@120-129) thing (13@130-139) ')' (14@140-149)
sending: '(' (15@150-159)
sending: 'x' (16@160-169)
thing (16@160-169): 'x' (16@160-169)
sending: ')' (17@170-179)
line (15@150-179): '(' (15@150-159) thing (16@160-169) ')' (17@170-179)
sending: '(' (18@180-189)
sending: 'x' (19@190-199)
thing (19@190-199): 'x' (19@190-199)
sending: ')' (20@200-209)
200-209: memory exhausted
Freeing nterm thing (19@190-199)
Freeing nterm line (15@150-179)
Freeing nterm line (12@120-149)
Freeing nterm line (9@90-119)
Freeing nterm line (6@60-89)
Freeing nterm line (3@30-59)
Freeing nterm line (0@0-29)
Parsing FAILED (status 2).
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/actions.at:574"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_90
#AT_START_91
# 91. actions.at:576: Printers and Destructors : %defines %skeleton "lalr1.cc"
at_setup_line='actions.at:576'
at_fn_banner 8
at_desc="Printers and Destructors : %defines %skeleton \"lalr1.cc\""
at_desc_line=" 91: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "91. actions.at:576: testing ..."
  $at_traceon



# Make sure complex $n work.

# Be sure to pass all the %directives to this macro to have correct
# helping macros.  So don't put any directly in the Bison file.





# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.











cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code requires {
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>

#define YYINITDEPTH 10
#define YYMAXDEPTH 10
#define RANGE(Location) (Location).begin.line, (Location).end.line
}

%error-verbose
%debug
%verbose
%locations
%defines %skeleton "lalr1.cc"

%define global_tokens_and_yystype
%code {
typedef yy::location YYLTYPE;
static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);

}



/* FIXME: This %printer isn't actually tested.  */
%printer
  {
    debug_stream () << $$;;
  }
  input line thing 'x' 'y'

%destructor
  { printf ("Freeing nterm input (%d@%d-%d)\n", $$, RANGE (@$)); }
  input

%destructor
  { printf ("Freeing nterm line (%d@%d-%d)\n", $$, RANGE (@$)); }
  line

%destructor
  { printf ("Freeing nterm thing (%d@%d-%d)\n", $$, RANGE (@$)); }
  thing

%destructor
  { printf ("Freeing token 'x' (%d@%d-%d)\n", $$, RANGE (@$)); }
  'x'

%destructor
  { printf ("Freeing token 'y' (%d@%d-%d)\n", $$, RANGE (@$)); }
  'y'

%token END 0
%destructor
  { printf ("Freeing token END (%d@%d-%d)\n", $$, RANGE (@$)); }
  END

%%
/*
   This grammar is made to exercise error recovery.
   "Lines" starting with `(' support error recovery, with
   ')' as synchronizing token.  Lines starting with 'x' can never
   be recovered from if in error.
*/

input:
  /* Nothing. */
    {
      $$ = 0;
      printf ("input (%d@%d-%d): /* Nothing */\n", $$, RANGE (@$));
    }
| line input /* Right recursive to load the stack so that popping at
		END can	be exercised.  */
    {
      $$ = 2;
      printf ("input (%d@%d-%d): line (%d@%d-%d) input (%d@%d-%d)\n",
	      $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2));
    }
;

line:
  thing thing thing ';'
    {
      $$ = $1;
      printf ("line (%d@%d-%d): thing (%d@%d-%d) thing (%d@%d-%d) thing (%d@%d-%d) ';' (%d@%d-%d)\n",
              $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2),
              $3, RANGE (@3), $4, RANGE (@4));
    }
| '(' thing thing ')'
    {
      $$ = $1;
      printf ("line (%d@%d-%d): '(' (%d@%d-%d) thing (%d@%d-%d) thing (%d@%d-%d) ')' (%d@%d-%d)\n",
              $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2),
              $3, RANGE (@3), $4, RANGE (@4));
    }
| '(' thing ')'
    {
      $$ = $1;
      printf ("line (%d@%d-%d): '(' (%d@%d-%d) thing (%d@%d-%d) ')' (%d@%d-%d)\n",
              $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2), $3, RANGE (@3));
    }
| '(' error ')'
    {
      $$ = -1;
      printf ("line (%d@%d-%d): '(' (%d@%d-%d) error (@%d-%d) ')' (%d@%d-%d)\n",
              $$, RANGE (@$), $1, RANGE (@1), RANGE (@2), $3, RANGE (@3));
    }
;

thing:
  'x'
    {
      $$ = $1;
      printf ("thing (%d@%d-%d): 'x' (%d@%d-%d)\n",
              $$, RANGE (@$), $1, RANGE (@1));
    }
;
%%
/* Alias to ARGV[1]. */
const char *source = 0;

static int
yylex (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  static unsigned int counter = 0;

  int c = (*lvalp) = counter++;
  /* As in BASIC, line numbers go from 10 to 10.  */
 (*llocp).begin.line = (*llocp).begin.column = 10 * c;
  (*llocp).end.line = (*llocp).end.column = (*llocp).begin.line + 9;


  if (! (0 <= c && c <= strlen (source)))
    abort ();
  if (source[c])
    printf ("sending: '%c'", source[c]);
  else
    printf ("sending: END");
  printf (" (%d@%d-%d)\n", c, RANGE ((*llocp)));
  return source[c];
}

/* A C++ error reporting function. */
void
yy::parser::error (const location& l, const std::string& m)
{
  printf ("%d-%d: %s\n", RANGE (l), m.c_str());
}

static bool yydebug;
int
yyparse ()
{
  yy::parser parser;
  parser.set_debug_level (yydebug);
  return parser.parse ();
}


int
main (int argc, const char *argv[])
{
  int status;
  yydebug = !!getenv ("YYDEBUG");
  assert (argc == 2);
  source = argv[1];
  status = yyparse ();
  switch (status)
    {
      case 0: printf ("Successful parse.\n"); break;
      case 1: printf ("Parsing FAILED.\n"); break;
      default: printf ("Parsing FAILED (status %d).\n", status); break;
    }
  return status;
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/actions.at:576: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:576"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:576"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:576: bison --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_trace "actions.at:576"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:576"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:576: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:576"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:576"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/actions.at:576: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:576"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:576"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/actions.at:576: bison -o input.cc input.y"
at_fn_check_prepare_trace "actions.at:576"
( $at_check_trace; bison -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:576"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/actions.at:576: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "actions.at:576"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:576"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:576: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "actions.at:576"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:576"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check the location of "empty"
# -----------------------------
# I.e., epsilon-reductions, as in "(x)" which ends by reducing
# an empty "line" nterm.
# FIXME: This location is not satisfying.  Depend on the lookahead?
{ set +x
$as_echo "$at_srcdir/actions.at:576:  \$PREPARSER ./input '(x)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:576"
( $at_check_trace;  $PREPARSER ./input '(x)'
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: ')' (2@20-29)
line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
sending: END (3@30-39)
input (0@29-29): /* Nothing */
input (2@0-29): line (0@0-29) input (0@29-29)
Freeing token END (3@30-39)
Freeing nterm input (2@0-29)
Successful parse.
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:576"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check locations in error recovery
# ---------------------------------
# '(y)' is an error, but can be recovered from.  But what's the location
# of the error itself ('y'), and of the resulting reduction ('(error)').
{ set +x
$as_echo "$at_srcdir/actions.at:576:  \$PREPARSER ./input '(y)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:576"
( $at_check_trace;  $PREPARSER ./input '(y)'
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "sending: '(' (0@0-9)
sending: 'y' (1@10-19)
10-19: syntax error, unexpected 'y', expecting 'x'
Freeing token 'y' (1@10-19)
sending: ')' (2@20-29)
line (-1@0-29): '(' (0@0-9) error (@10-19) ')' (2@20-29)
sending: END (3@30-39)
input (0@29-29): /* Nothing */
input (2@0-29): line (-1@0-29) input (0@29-29)
Freeing token END (3@30-39)
Freeing nterm input (2@0-29)
Successful parse.
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:576"
$at_failed && at_fn_log_failure
$at_traceon; }



# Syntax errors caught by the parser
# ----------------------------------
# Exercise the discarding of stack top and input until `error'
# can be reduced.
#
#     '(', 'x', 'x', 'x', 'x', 'x', ')',
#
# Load the stack and provoke an error that cannot be caught by the
# grammar, to check that the stack is cleared.  And make sure the
# lookahead is freed.
#
#     '(', 'x', ')',
#     '(', 'x', ')',
#     'y'
{ set +x
$as_echo "$at_srcdir/actions.at:576:  \$PREPARSER ./input '(xxxxx)(x)(x)y'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:576"
( $at_check_trace;  $PREPARSER ./input '(xxxxx)(x)(x)y'
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: 'x' (2@20-29)
thing (2@20-29): 'x' (2@20-29)
sending: 'x' (3@30-39)
30-39: syntax error, unexpected 'x', expecting ')'
Freeing nterm thing (2@20-29)
Freeing nterm thing (1@10-19)
Freeing token 'x' (3@30-39)
sending: 'x' (4@40-49)
Freeing token 'x' (4@40-49)
sending: 'x' (5@50-59)
Freeing token 'x' (5@50-59)
sending: ')' (6@60-69)
line (-1@0-69): '(' (0@0-9) error (@10-59) ')' (6@60-69)
sending: '(' (7@70-79)
sending: 'x' (8@80-89)
thing (8@80-89): 'x' (8@80-89)
sending: ')' (9@90-99)
line (7@70-99): '(' (7@70-79) thing (8@80-89) ')' (9@90-99)
sending: '(' (10@100-109)
sending: 'x' (11@110-119)
thing (11@110-119): 'x' (11@110-119)
sending: ')' (12@120-129)
line (10@100-129): '(' (10@100-109) thing (11@110-119) ')' (12@120-129)
sending: 'y' (13@130-139)
input (0@129-129): /* Nothing */
input (2@100-129): line (10@100-129) input (0@129-129)
input (2@70-129): line (7@70-99) input (2@100-129)
input (2@0-129): line (-1@0-69) input (2@70-129)
130-139: syntax error, unexpected 'y', expecting END
Freeing nterm input (2@0-129)
Freeing token 'y' (13@130-139)
Parsing FAILED.
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:576"
$at_failed && at_fn_log_failure
$at_traceon; }



# Syntax error caught by the parser where lookahead = END
# --------------------------------------------------------
# Load the stack and provoke an error that cannot be caught by the
# grammar, to check that the stack is cleared.  And make sure the
# lookahead is freed.
#
#     '(', 'x', ')',
#     '(', 'x', ')',
#     'x'
{ set +x
$as_echo "$at_srcdir/actions.at:576:  \$PREPARSER ./input '(x)(x)x'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:576"
( $at_check_trace;  $PREPARSER ./input '(x)(x)x'
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: ')' (2@20-29)
line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
sending: '(' (3@30-39)
sending: 'x' (4@40-49)
thing (4@40-49): 'x' (4@40-49)
sending: ')' (5@50-59)
line (3@30-59): '(' (3@30-39) thing (4@40-49) ')' (5@50-59)
sending: 'x' (6@60-69)
thing (6@60-69): 'x' (6@60-69)
sending: END (7@70-79)
70-79: syntax error, unexpected END, expecting 'x'
Freeing nterm thing (6@60-69)
Freeing nterm line (3@30-59)
Freeing nterm line (0@0-29)
Freeing token END (7@70-79)
Parsing FAILED.
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:576"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check destruction upon stack overflow
# -------------------------------------
# Upon stack overflow, all symbols on the stack should be destroyed.
# Only check for yacc.c.




  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_91
#AT_START_92
# 92. actions.at:577: Printers and Destructors with union: %defines %skeleton "lalr1.cc"
at_setup_line='actions.at:577'
at_fn_banner 8
at_desc="Printers and Destructors with union: %defines %skeleton \"lalr1.cc\""
at_desc_line=" 92: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "92. actions.at:577: testing ..."
  $at_traceon



# Make sure complex $n work.

# Be sure to pass all the %directives to this macro to have correct
# helping macros.  So don't put any directly in the Bison file.





# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.











cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code requires {
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>

#define YYINITDEPTH 10
#define YYMAXDEPTH 10
#define RANGE(Location) (Location).begin.line, (Location).end.line
}

%error-verbose
%debug
%verbose
%locations
%defines %skeleton "lalr1.cc"
%union
{
  int ival;
}
%define global_tokens_and_yystype
%code provides {
typedef yy::location YYLTYPE;
static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);

}

%type <ival> '(' 'x' 'y' ')' ';' thing line input END

/* FIXME: This %printer isn't actually tested.  */
%printer
  {
    debug_stream () << $$;;
  }
  input line thing 'x' 'y'

%destructor
  { printf ("Freeing nterm input (%d@%d-%d)\n", $$, RANGE (@$)); }
  input

%destructor
  { printf ("Freeing nterm line (%d@%d-%d)\n", $$, RANGE (@$)); }
  line

%destructor
  { printf ("Freeing nterm thing (%d@%d-%d)\n", $$, RANGE (@$)); }
  thing

%destructor
  { printf ("Freeing token 'x' (%d@%d-%d)\n", $$, RANGE (@$)); }
  'x'

%destructor
  { printf ("Freeing token 'y' (%d@%d-%d)\n", $$, RANGE (@$)); }
  'y'

%token END 0
%destructor
  { printf ("Freeing token END (%d@%d-%d)\n", $$, RANGE (@$)); }
  END

%%
/*
   This grammar is made to exercise error recovery.
   "Lines" starting with `(' support error recovery, with
   ')' as synchronizing token.  Lines starting with 'x' can never
   be recovered from if in error.
*/

input:
  /* Nothing. */
    {
      $$ = 0;
      printf ("input (%d@%d-%d): /* Nothing */\n", $$, RANGE (@$));
    }
| line input /* Right recursive to load the stack so that popping at
		END can	be exercised.  */
    {
      $$ = 2;
      printf ("input (%d@%d-%d): line (%d@%d-%d) input (%d@%d-%d)\n",
	      $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2));
    }
;

line:
  thing thing thing ';'
    {
      $$ = $1;
      printf ("line (%d@%d-%d): thing (%d@%d-%d) thing (%d@%d-%d) thing (%d@%d-%d) ';' (%d@%d-%d)\n",
              $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2),
              $3, RANGE (@3), $4, RANGE (@4));
    }
| '(' thing thing ')'
    {
      $$ = $1;
      printf ("line (%d@%d-%d): '(' (%d@%d-%d) thing (%d@%d-%d) thing (%d@%d-%d) ')' (%d@%d-%d)\n",
              $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2),
              $3, RANGE (@3), $4, RANGE (@4));
    }
| '(' thing ')'
    {
      $$ = $1;
      printf ("line (%d@%d-%d): '(' (%d@%d-%d) thing (%d@%d-%d) ')' (%d@%d-%d)\n",
              $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2), $3, RANGE (@3));
    }
| '(' error ')'
    {
      $$ = -1;
      printf ("line (%d@%d-%d): '(' (%d@%d-%d) error (@%d-%d) ')' (%d@%d-%d)\n",
              $$, RANGE (@$), $1, RANGE (@1), RANGE (@2), $3, RANGE (@3));
    }
;

thing:
  'x'
    {
      $$ = $1;
      printf ("thing (%d@%d-%d): 'x' (%d@%d-%d)\n",
              $$, RANGE (@$), $1, RANGE (@1));
    }
;
%%
/* Alias to ARGV[1]. */
const char *source = 0;

static int
yylex (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  static unsigned int counter = 0;

  int c = (*lvalp).ival = counter++;
  /* As in BASIC, line numbers go from 10 to 10.  */
 (*llocp).begin.line = (*llocp).begin.column = 10 * c;
  (*llocp).end.line = (*llocp).end.column = (*llocp).begin.line + 9;


  if (! (0 <= c && c <= strlen (source)))
    abort ();
  if (source[c])
    printf ("sending: '%c'", source[c]);
  else
    printf ("sending: END");
  printf (" (%d@%d-%d)\n", c, RANGE ((*llocp)));
  return source[c];
}

/* A C++ error reporting function. */
void
yy::parser::error (const location& l, const std::string& m)
{
  printf ("%d-%d: %s\n", RANGE (l), m.c_str());
}

static bool yydebug;
int
yyparse ()
{
  yy::parser parser;
  parser.set_debug_level (yydebug);
  return parser.parse ();
}


int
main (int argc, const char *argv[])
{
  int status;
  yydebug = !!getenv ("YYDEBUG");
  assert (argc == 2);
  source = argv[1];
  status = yyparse ();
  switch (status)
    {
      case 0: printf ("Successful parse.\n"); break;
      case 1: printf ("Parsing FAILED.\n"); break;
      default: printf ("Parsing FAILED (status %d).\n", status); break;
    }
  return status;
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/actions.at:577: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:577"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:577"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:577: bison --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_trace "actions.at:577"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:577"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:577: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:577"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:577"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/actions.at:577: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:577"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:577"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/actions.at:577: bison -o input.cc input.y"
at_fn_check_prepare_trace "actions.at:577"
( $at_check_trace; bison -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:577"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/actions.at:577: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "actions.at:577"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:577"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:577: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "actions.at:577"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:577"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check the location of "empty"
# -----------------------------
# I.e., epsilon-reductions, as in "(x)" which ends by reducing
# an empty "line" nterm.
# FIXME: This location is not satisfying.  Depend on the lookahead?
{ set +x
$as_echo "$at_srcdir/actions.at:577:  \$PREPARSER ./input '(x)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:577"
( $at_check_trace;  $PREPARSER ./input '(x)'
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: ')' (2@20-29)
line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
sending: END (3@30-39)
input (0@29-29): /* Nothing */
input (2@0-29): line (0@0-29) input (0@29-29)
Freeing token END (3@30-39)
Freeing nterm input (2@0-29)
Successful parse.
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:577"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check locations in error recovery
# ---------------------------------
# '(y)' is an error, but can be recovered from.  But what's the location
# of the error itself ('y'), and of the resulting reduction ('(error)').
{ set +x
$as_echo "$at_srcdir/actions.at:577:  \$PREPARSER ./input '(y)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:577"
( $at_check_trace;  $PREPARSER ./input '(y)'
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "sending: '(' (0@0-9)
sending: 'y' (1@10-19)
10-19: syntax error, unexpected 'y', expecting 'x'
Freeing token 'y' (1@10-19)
sending: ')' (2@20-29)
line (-1@0-29): '(' (0@0-9) error (@10-19) ')' (2@20-29)
sending: END (3@30-39)
input (0@29-29): /* Nothing */
input (2@0-29): line (-1@0-29) input (0@29-29)
Freeing token END (3@30-39)
Freeing nterm input (2@0-29)
Successful parse.
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:577"
$at_failed && at_fn_log_failure
$at_traceon; }



# Syntax errors caught by the parser
# ----------------------------------
# Exercise the discarding of stack top and input until `error'
# can be reduced.
#
#     '(', 'x', 'x', 'x', 'x', 'x', ')',
#
# Load the stack and provoke an error that cannot be caught by the
# grammar, to check that the stack is cleared.  And make sure the
# lookahead is freed.
#
#     '(', 'x', ')',
#     '(', 'x', ')',
#     'y'
{ set +x
$as_echo "$at_srcdir/actions.at:577:  \$PREPARSER ./input '(xxxxx)(x)(x)y'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:577"
( $at_check_trace;  $PREPARSER ./input '(xxxxx)(x)(x)y'
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: 'x' (2@20-29)
thing (2@20-29): 'x' (2@20-29)
sending: 'x' (3@30-39)
30-39: syntax error, unexpected 'x', expecting ')'
Freeing nterm thing (2@20-29)
Freeing nterm thing (1@10-19)
Freeing token 'x' (3@30-39)
sending: 'x' (4@40-49)
Freeing token 'x' (4@40-49)
sending: 'x' (5@50-59)
Freeing token 'x' (5@50-59)
sending: ')' (6@60-69)
line (-1@0-69): '(' (0@0-9) error (@10-59) ')' (6@60-69)
sending: '(' (7@70-79)
sending: 'x' (8@80-89)
thing (8@80-89): 'x' (8@80-89)
sending: ')' (9@90-99)
line (7@70-99): '(' (7@70-79) thing (8@80-89) ')' (9@90-99)
sending: '(' (10@100-109)
sending: 'x' (11@110-119)
thing (11@110-119): 'x' (11@110-119)
sending: ')' (12@120-129)
line (10@100-129): '(' (10@100-109) thing (11@110-119) ')' (12@120-129)
sending: 'y' (13@130-139)
input (0@129-129): /* Nothing */
input (2@100-129): line (10@100-129) input (0@129-129)
input (2@70-129): line (7@70-99) input (2@100-129)
input (2@0-129): line (-1@0-69) input (2@70-129)
130-139: syntax error, unexpected 'y', expecting END
Freeing nterm input (2@0-129)
Freeing token 'y' (13@130-139)
Parsing FAILED.
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:577"
$at_failed && at_fn_log_failure
$at_traceon; }



# Syntax error caught by the parser where lookahead = END
# --------------------------------------------------------
# Load the stack and provoke an error that cannot be caught by the
# grammar, to check that the stack is cleared.  And make sure the
# lookahead is freed.
#
#     '(', 'x', ')',
#     '(', 'x', ')',
#     'x'
{ set +x
$as_echo "$at_srcdir/actions.at:577:  \$PREPARSER ./input '(x)(x)x'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:577"
( $at_check_trace;  $PREPARSER ./input '(x)(x)x'
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: ')' (2@20-29)
line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
sending: '(' (3@30-39)
sending: 'x' (4@40-49)
thing (4@40-49): 'x' (4@40-49)
sending: ')' (5@50-59)
line (3@30-59): '(' (3@30-39) thing (4@40-49) ')' (5@50-59)
sending: 'x' (6@60-69)
thing (6@60-69): 'x' (6@60-69)
sending: END (7@70-79)
70-79: syntax error, unexpected END, expecting 'x'
Freeing nterm thing (6@60-69)
Freeing nterm line (3@30-59)
Freeing nterm line (0@0-29)
Freeing token END (7@70-79)
Parsing FAILED.
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:577"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check destruction upon stack overflow
# -------------------------------------
# Upon stack overflow, all symbols on the stack should be destroyed.
# Only check for yacc.c.




  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_92
#AT_START_93
# 93. actions.at:579: Printers and Destructors : %glr-parser
at_setup_line='actions.at:579'
at_fn_banner 8
at_desc="Printers and Destructors : %glr-parser"
at_desc_line=" 93: $at_desc         "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "93. actions.at:579: testing ..."
  $at_traceon



# Make sure complex $n work.

# Be sure to pass all the %directives to this macro to have correct
# helping macros.  So don't put any directly in the Bison file.





# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.











cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code requires {
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>

#define YYINITDEPTH 10
#define YYMAXDEPTH 10
#define RANGE(Location) (Location).first_line, (Location).last_line
}

%error-verbose
%debug
%verbose
%locations
%glr-parser


%code {

static int yylex (void);
static void yyerror (const char *msg);
}



/* FIXME: This %printer isn't actually tested.  */
%printer
  {
    fprintf (yyoutput, "%d", $$);
  }
  input line thing 'x' 'y'

%destructor
  { printf ("Freeing nterm input (%d@%d-%d)\n", $$, RANGE (@$)); }
  input

%destructor
  { printf ("Freeing nterm line (%d@%d-%d)\n", $$, RANGE (@$)); }
  line

%destructor
  { printf ("Freeing nterm thing (%d@%d-%d)\n", $$, RANGE (@$)); }
  thing

%destructor
  { printf ("Freeing token 'x' (%d@%d-%d)\n", $$, RANGE (@$)); }
  'x'

%destructor
  { printf ("Freeing token 'y' (%d@%d-%d)\n", $$, RANGE (@$)); }
  'y'

%token END 0
%destructor
  { printf ("Freeing token END (%d@%d-%d)\n", $$, RANGE (@$)); }
  END

%%
/*
   This grammar is made to exercise error recovery.
   "Lines" starting with `(' support error recovery, with
   ')' as synchronizing token.  Lines starting with 'x' can never
   be recovered from if in error.
*/

input:
  /* Nothing. */
    {
      $$ = 0;
      printf ("input (%d@%d-%d): /* Nothing */\n", $$, RANGE (@$));
    }
| line input /* Right recursive to load the stack so that popping at
		END can	be exercised.  */
    {
      $$ = 2;
      printf ("input (%d@%d-%d): line (%d@%d-%d) input (%d@%d-%d)\n",
	      $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2));
    }
;

line:
  thing thing thing ';'
    {
      $$ = $1;
      printf ("line (%d@%d-%d): thing (%d@%d-%d) thing (%d@%d-%d) thing (%d@%d-%d) ';' (%d@%d-%d)\n",
              $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2),
              $3, RANGE (@3), $4, RANGE (@4));
    }
| '(' thing thing ')'
    {
      $$ = $1;
      printf ("line (%d@%d-%d): '(' (%d@%d-%d) thing (%d@%d-%d) thing (%d@%d-%d) ')' (%d@%d-%d)\n",
              $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2),
              $3, RANGE (@3), $4, RANGE (@4));
    }
| '(' thing ')'
    {
      $$ = $1;
      printf ("line (%d@%d-%d): '(' (%d@%d-%d) thing (%d@%d-%d) ')' (%d@%d-%d)\n",
              $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2), $3, RANGE (@3));
    }
| '(' error ')'
    {
      $$ = -1;
      printf ("line (%d@%d-%d): '(' (%d@%d-%d) error (@%d-%d) ')' (%d@%d-%d)\n",
              $$, RANGE (@$), $1, RANGE (@1), RANGE (@2), $3, RANGE (@3));
    }
;

thing:
  'x'
    {
      $$ = $1;
      printf ("thing (%d@%d-%d): 'x' (%d@%d-%d)\n",
              $$, RANGE (@$), $1, RANGE (@1));
    }
;
%%
/* Alias to ARGV[1]. */
const char *source = 0;

static int
yylex (void)
{
  static unsigned int counter = 0;

  int c = (yylval) = counter++;
  /* As in BASIC, line numbers go from 10 to 10.  */
 (yylloc).first_line = (yylloc).first_column = 10 * c;
  (yylloc).last_line = (yylloc).last_column = (yylloc).first_line + 9;


  if (! (0 <= c && c <= strlen (source)))
    abort ();
  if (source[c])
    printf ("sending: '%c'", source[c]);
  else
    printf ("sending: END");
  printf (" (%d@%d-%d)\n", c, RANGE ((yylloc)));
  return source[c];
}

static void
yyerror (const char *msg)
{
  printf ("%d-%d: %s\n", RANGE (yylloc), msg);
}

int
main (int argc, const char *argv[])
{
  int status;
  yydebug = !!getenv ("YYDEBUG");
  assert (argc == 2);
  source = argv[1];
  status = yyparse ();
  switch (status)
    {
      case 0: printf ("Successful parse.\n"); break;
      case 1: printf ("Parsing FAILED.\n"); break;
      default: printf ("Parsing FAILED (status %d).\n", status); break;
    }
  return status;
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/actions.at:579: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:579"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:579"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:579: bison --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_trace "actions.at:579"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:579"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:579: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:579"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:579"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/actions.at:579: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:579"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:579"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/actions.at:579: bison -o input.c input.y"
at_fn_check_prepare_trace "actions.at:579"
( $at_check_trace; bison -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:579"
$at_failed && at_fn_log_failure
$at_traceon; }

   { set +x
$as_echo "$at_srcdir/actions.at:579: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:579"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:579"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check the location of "empty"
# -----------------------------
# I.e., epsilon-reductions, as in "(x)" which ends by reducing
# an empty "line" nterm.
# FIXME: This location is not satisfying.  Depend on the lookahead?
{ set +x
$as_echo "$at_srcdir/actions.at:579:  \$PREPARSER ./input '(x)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:579"
( $at_check_trace;  $PREPARSER ./input '(x)'
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: ')' (2@20-29)
line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
sending: END (3@30-39)
input (0@29-29): /* Nothing */
input (2@0-29): line (0@0-29) input (0@29-29)
Freeing token END (3@30-39)
Freeing nterm input (2@0-29)
Successful parse.
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:579"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check locations in error recovery
# ---------------------------------
# '(y)' is an error, but can be recovered from.  But what's the location
# of the error itself ('y'), and of the resulting reduction ('(error)').
{ set +x
$as_echo "$at_srcdir/actions.at:579:  \$PREPARSER ./input '(y)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:579"
( $at_check_trace;  $PREPARSER ./input '(y)'
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "sending: '(' (0@0-9)
sending: 'y' (1@10-19)
10-19: syntax error, unexpected 'y', expecting 'x'
Freeing token 'y' (1@10-19)
sending: ')' (2@20-29)
line (-1@0-29): '(' (0@0-9) error (@10-19) ')' (2@20-29)
sending: END (3@30-39)
input (0@29-29): /* Nothing */
input (2@0-29): line (-1@0-29) input (0@29-29)
Freeing token END (3@30-39)
Freeing nterm input (2@0-29)
Successful parse.
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:579"
$at_failed && at_fn_log_failure
$at_traceon; }



# Syntax errors caught by the parser
# ----------------------------------
# Exercise the discarding of stack top and input until `error'
# can be reduced.
#
#     '(', 'x', 'x', 'x', 'x', 'x', ')',
#
# Load the stack and provoke an error that cannot be caught by the
# grammar, to check that the stack is cleared.  And make sure the
# lookahead is freed.
#
#     '(', 'x', ')',
#     '(', 'x', ')',
#     'y'
{ set +x
$as_echo "$at_srcdir/actions.at:579:  \$PREPARSER ./input '(xxxxx)(x)(x)y'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:579"
( $at_check_trace;  $PREPARSER ./input '(xxxxx)(x)(x)y'
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: 'x' (2@20-29)
thing (2@20-29): 'x' (2@20-29)
sending: 'x' (3@30-39)
30-39: syntax error, unexpected 'x', expecting ')'
Freeing nterm thing (2@20-29)
Freeing nterm thing (1@10-19)
Freeing token 'x' (3@30-39)
sending: 'x' (4@40-49)
Freeing token 'x' (4@40-49)
sending: 'x' (5@50-59)
Freeing token 'x' (5@50-59)
sending: ')' (6@60-69)
line (-1@0-69): '(' (0@0-9) error (@10-59) ')' (6@60-69)
sending: '(' (7@70-79)
sending: 'x' (8@80-89)
thing (8@80-89): 'x' (8@80-89)
sending: ')' (9@90-99)
line (7@70-99): '(' (7@70-79) thing (8@80-89) ')' (9@90-99)
sending: '(' (10@100-109)
sending: 'x' (11@110-119)
thing (11@110-119): 'x' (11@110-119)
sending: ')' (12@120-129)
line (10@100-129): '(' (10@100-109) thing (11@110-119) ')' (12@120-129)
sending: 'y' (13@130-139)
input (0@129-129): /* Nothing */
input (2@100-129): line (10@100-129) input (0@129-129)
input (2@70-129): line (7@70-99) input (2@100-129)
input (2@0-129): line (-1@0-69) input (2@70-129)
130-139: syntax error, unexpected 'y', expecting END
Freeing nterm input (2@0-129)
Freeing token 'y' (13@130-139)
Parsing FAILED.
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:579"
$at_failed && at_fn_log_failure
$at_traceon; }



# Syntax error caught by the parser where lookahead = END
# --------------------------------------------------------
# Load the stack and provoke an error that cannot be caught by the
# grammar, to check that the stack is cleared.  And make sure the
# lookahead is freed.
#
#     '(', 'x', ')',
#     '(', 'x', ')',
#     'x'
{ set +x
$as_echo "$at_srcdir/actions.at:579:  \$PREPARSER ./input '(x)(x)x'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:579"
( $at_check_trace;  $PREPARSER ./input '(x)(x)x'
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: ')' (2@20-29)
line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
sending: '(' (3@30-39)
sending: 'x' (4@40-49)
thing (4@40-49): 'x' (4@40-49)
sending: ')' (5@50-59)
line (3@30-59): '(' (3@30-39) thing (4@40-49) ')' (5@50-59)
sending: 'x' (6@60-69)
thing (6@60-69): 'x' (6@60-69)
sending: END (7@70-79)
70-79: syntax error, unexpected END, expecting 'x'
Freeing nterm thing (6@60-69)
Freeing nterm line (3@30-59)
Freeing nterm line (0@0-29)
Freeing token END (7@70-79)
Parsing FAILED.
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:579"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check destruction upon stack overflow
# -------------------------------------
# Upon stack overflow, all symbols on the stack should be destroyed.
# Only check for yacc.c.




  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_93
#AT_START_94
# 94. actions.at:580: Printers and Destructors with union: %glr-parser
at_setup_line='actions.at:580'
at_fn_banner 8
at_desc="Printers and Destructors with union: %glr-parser"
at_desc_line=" 94: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "94. actions.at:580: testing ..."
  $at_traceon



# Make sure complex $n work.

# Be sure to pass all the %directives to this macro to have correct
# helping macros.  So don't put any directly in the Bison file.





# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.











cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code requires {
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>

#define YYINITDEPTH 10
#define YYMAXDEPTH 10
#define RANGE(Location) (Location).first_line, (Location).last_line
}

%error-verbose
%debug
%verbose
%locations
%glr-parser
%union
{
  int ival;
}

%code provides {

static int yylex (void);
static void yyerror (const char *msg);
}

%type <ival> '(' 'x' 'y' ')' ';' thing line input END

/* FIXME: This %printer isn't actually tested.  */
%printer
  {
    fprintf (yyoutput, "%d", $$);
  }
  input line thing 'x' 'y'

%destructor
  { printf ("Freeing nterm input (%d@%d-%d)\n", $$, RANGE (@$)); }
  input

%destructor
  { printf ("Freeing nterm line (%d@%d-%d)\n", $$, RANGE (@$)); }
  line

%destructor
  { printf ("Freeing nterm thing (%d@%d-%d)\n", $$, RANGE (@$)); }
  thing

%destructor
  { printf ("Freeing token 'x' (%d@%d-%d)\n", $$, RANGE (@$)); }
  'x'

%destructor
  { printf ("Freeing token 'y' (%d@%d-%d)\n", $$, RANGE (@$)); }
  'y'

%token END 0
%destructor
  { printf ("Freeing token END (%d@%d-%d)\n", $$, RANGE (@$)); }
  END

%%
/*
   This grammar is made to exercise error recovery.
   "Lines" starting with `(' support error recovery, with
   ')' as synchronizing token.  Lines starting with 'x' can never
   be recovered from if in error.
*/

input:
  /* Nothing. */
    {
      $$ = 0;
      printf ("input (%d@%d-%d): /* Nothing */\n", $$, RANGE (@$));
    }
| line input /* Right recursive to load the stack so that popping at
		END can	be exercised.  */
    {
      $$ = 2;
      printf ("input (%d@%d-%d): line (%d@%d-%d) input (%d@%d-%d)\n",
	      $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2));
    }
;

line:
  thing thing thing ';'
    {
      $$ = $1;
      printf ("line (%d@%d-%d): thing (%d@%d-%d) thing (%d@%d-%d) thing (%d@%d-%d) ';' (%d@%d-%d)\n",
              $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2),
              $3, RANGE (@3), $4, RANGE (@4));
    }
| '(' thing thing ')'
    {
      $$ = $1;
      printf ("line (%d@%d-%d): '(' (%d@%d-%d) thing (%d@%d-%d) thing (%d@%d-%d) ')' (%d@%d-%d)\n",
              $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2),
              $3, RANGE (@3), $4, RANGE (@4));
    }
| '(' thing ')'
    {
      $$ = $1;
      printf ("line (%d@%d-%d): '(' (%d@%d-%d) thing (%d@%d-%d) ')' (%d@%d-%d)\n",
              $$, RANGE (@$), $1, RANGE (@1), $2, RANGE (@2), $3, RANGE (@3));
    }
| '(' error ')'
    {
      $$ = -1;
      printf ("line (%d@%d-%d): '(' (%d@%d-%d) error (@%d-%d) ')' (%d@%d-%d)\n",
              $$, RANGE (@$), $1, RANGE (@1), RANGE (@2), $3, RANGE (@3));
    }
;

thing:
  'x'
    {
      $$ = $1;
      printf ("thing (%d@%d-%d): 'x' (%d@%d-%d)\n",
              $$, RANGE (@$), $1, RANGE (@1));
    }
;
%%
/* Alias to ARGV[1]. */
const char *source = 0;

static int
yylex (void)
{
  static unsigned int counter = 0;

  int c = (yylval).ival = counter++;
  /* As in BASIC, line numbers go from 10 to 10.  */
 (yylloc).first_line = (yylloc).first_column = 10 * c;
  (yylloc).last_line = (yylloc).last_column = (yylloc).first_line + 9;


  if (! (0 <= c && c <= strlen (source)))
    abort ();
  if (source[c])
    printf ("sending: '%c'", source[c]);
  else
    printf ("sending: END");
  printf (" (%d@%d-%d)\n", c, RANGE ((yylloc)));
  return source[c];
}

static void
yyerror (const char *msg)
{
  printf ("%d-%d: %s\n", RANGE (yylloc), msg);
}

int
main (int argc, const char *argv[])
{
  int status;
  yydebug = !!getenv ("YYDEBUG");
  assert (argc == 2);
  source = argv[1];
  status = yyparse ();
  switch (status)
    {
      case 0: printf ("Successful parse.\n"); break;
      case 1: printf ("Parsing FAILED.\n"); break;
      default: printf ("Parsing FAILED (status %d).\n", status); break;
    }
  return status;
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/actions.at:580: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:580"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:580"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:580: bison --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_trace "actions.at:580"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:580"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:580: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:580"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:580"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/actions.at:580: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:580"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:580"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/actions.at:580: bison -o input.c input.y"
at_fn_check_prepare_trace "actions.at:580"
( $at_check_trace; bison -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:580"
$at_failed && at_fn_log_failure
$at_traceon; }

   { set +x
$as_echo "$at_srcdir/actions.at:580: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:580"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:580"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check the location of "empty"
# -----------------------------
# I.e., epsilon-reductions, as in "(x)" which ends by reducing
# an empty "line" nterm.
# FIXME: This location is not satisfying.  Depend on the lookahead?
{ set +x
$as_echo "$at_srcdir/actions.at:580:  \$PREPARSER ./input '(x)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:580"
( $at_check_trace;  $PREPARSER ./input '(x)'
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: ')' (2@20-29)
line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
sending: END (3@30-39)
input (0@29-29): /* Nothing */
input (2@0-29): line (0@0-29) input (0@29-29)
Freeing token END (3@30-39)
Freeing nterm input (2@0-29)
Successful parse.
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:580"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check locations in error recovery
# ---------------------------------
# '(y)' is an error, but can be recovered from.  But what's the location
# of the error itself ('y'), and of the resulting reduction ('(error)').
{ set +x
$as_echo "$at_srcdir/actions.at:580:  \$PREPARSER ./input '(y)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:580"
( $at_check_trace;  $PREPARSER ./input '(y)'
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "sending: '(' (0@0-9)
sending: 'y' (1@10-19)
10-19: syntax error, unexpected 'y', expecting 'x'
Freeing token 'y' (1@10-19)
sending: ')' (2@20-29)
line (-1@0-29): '(' (0@0-9) error (@10-19) ')' (2@20-29)
sending: END (3@30-39)
input (0@29-29): /* Nothing */
input (2@0-29): line (-1@0-29) input (0@29-29)
Freeing token END (3@30-39)
Freeing nterm input (2@0-29)
Successful parse.
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:580"
$at_failed && at_fn_log_failure
$at_traceon; }



# Syntax errors caught by the parser
# ----------------------------------
# Exercise the discarding of stack top and input until `error'
# can be reduced.
#
#     '(', 'x', 'x', 'x', 'x', 'x', ')',
#
# Load the stack and provoke an error that cannot be caught by the
# grammar, to check that the stack is cleared.  And make sure the
# lookahead is freed.
#
#     '(', 'x', ')',
#     '(', 'x', ')',
#     'y'
{ set +x
$as_echo "$at_srcdir/actions.at:580:  \$PREPARSER ./input '(xxxxx)(x)(x)y'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:580"
( $at_check_trace;  $PREPARSER ./input '(xxxxx)(x)(x)y'
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: 'x' (2@20-29)
thing (2@20-29): 'x' (2@20-29)
sending: 'x' (3@30-39)
30-39: syntax error, unexpected 'x', expecting ')'
Freeing nterm thing (2@20-29)
Freeing nterm thing (1@10-19)
Freeing token 'x' (3@30-39)
sending: 'x' (4@40-49)
Freeing token 'x' (4@40-49)
sending: 'x' (5@50-59)
Freeing token 'x' (5@50-59)
sending: ')' (6@60-69)
line (-1@0-69): '(' (0@0-9) error (@10-59) ')' (6@60-69)
sending: '(' (7@70-79)
sending: 'x' (8@80-89)
thing (8@80-89): 'x' (8@80-89)
sending: ')' (9@90-99)
line (7@70-99): '(' (7@70-79) thing (8@80-89) ')' (9@90-99)
sending: '(' (10@100-109)
sending: 'x' (11@110-119)
thing (11@110-119): 'x' (11@110-119)
sending: ')' (12@120-129)
line (10@100-129): '(' (10@100-109) thing (11@110-119) ')' (12@120-129)
sending: 'y' (13@130-139)
input (0@129-129): /* Nothing */
input (2@100-129): line (10@100-129) input (0@129-129)
input (2@70-129): line (7@70-99) input (2@100-129)
input (2@0-129): line (-1@0-69) input (2@70-129)
130-139: syntax error, unexpected 'y', expecting END
Freeing nterm input (2@0-129)
Freeing token 'y' (13@130-139)
Parsing FAILED.
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:580"
$at_failed && at_fn_log_failure
$at_traceon; }



# Syntax error caught by the parser where lookahead = END
# --------------------------------------------------------
# Load the stack and provoke an error that cannot be caught by the
# grammar, to check that the stack is cleared.  And make sure the
# lookahead is freed.
#
#     '(', 'x', ')',
#     '(', 'x', ')',
#     'x'
{ set +x
$as_echo "$at_srcdir/actions.at:580:  \$PREPARSER ./input '(x)(x)x'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:580"
( $at_check_trace;  $PREPARSER ./input '(x)(x)x'
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: ')' (2@20-29)
line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
sending: '(' (3@30-39)
sending: 'x' (4@40-49)
thing (4@40-49): 'x' (4@40-49)
sending: ')' (5@50-59)
line (3@30-59): '(' (3@30-39) thing (4@40-49) ')' (5@50-59)
sending: 'x' (6@60-69)
thing (6@60-69): 'x' (6@60-69)
sending: END (7@70-79)
70-79: syntax error, unexpected END, expecting 'x'
Freeing nterm thing (6@60-69)
Freeing nterm line (3@30-59)
Freeing nterm line (0@0-29)
Freeing token END (7@70-79)
Parsing FAILED.
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:580"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check destruction upon stack overflow
# -------------------------------------
# Upon stack overflow, all symbols on the stack should be destroyed.
# Only check for yacc.c.




  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_94
#AT_START_95
# 95. actions.at:591: Default tagless %printer and %destructor
at_setup_line='actions.at:591'
at_fn_banner 8
at_desc="Default tagless %printer and %destructor"
at_desc_line=" 95: $at_desc       "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "95. actions.at:591: testing ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%error-verbose
%debug
%locations
%initial-action {
  @$.first_line = @$.last_line = 1;
  @$.first_column = @$.last_column = 1;
}

%{
# include <stdio.h>
# include <stdlib.h>
  static void yyerror (const char *msg);
  static int yylex (void);
# define USE(SYM)
%}

%printer {
  fprintf (yyoutput, "<*> printer should not be called.\n");
} <*>

%printer {
  fprintf (yyoutput, "<> printer for '%c' @ %d", $$, @$.first_column);
} <>
%destructor {
  fprintf (stdout, "<> destructor for '%c' @ %d.\n", $$, @$.first_column);
} <>

%printer {
  fprintf (yyoutput, "'b'/'c' printer for '%c' @ %d", $$, @$.first_column);
} 'b' 'c'
%destructor {
  fprintf (stdout, "'b'/'c' destructor for '%c' @ %d.\n", $$, @$.first_column);
} 'b' 'c'

%destructor {
  fprintf (yyoutput, "<*> destructor should not be called.\n");
} <*>

%%

start: 'a' 'b' 'c' 'd' 'e' { $$ = 'S'; USE(($1, $2, $3, $4, $5)); } ;

%%

static int
yylex (void)
{
  static char const input[] = "abcd";
  static size_t toknum;
  if (! (toknum < sizeof input))
    abort ();
  yylval = input[toknum++];
  yylloc.first_line = yylloc.last_line = 1;
  yylloc.first_column = yylloc.last_column = toknum;
  return yylval;
}

static void
yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}

int
main (void)
{
  yydebug = 1;
  return yyparse ();
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/actions.at:665: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:665"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:665"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:665: bison --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_trace "actions.at:665"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:665"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:665: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:665"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:665"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/actions.at:665: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:665"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:665"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/actions.at:665: bison -o input.c input.y"
at_fn_check_prepare_trace "actions.at:665"
( $at_check_trace; bison -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:665"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:666: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:666"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:666"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:667:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:667"
( $at_check_trace;  $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "Starting parse
Entering state 0
Reading a token: Next token is token 'a' (1.1-1.1: <> printer for 'a' @ 1)
Shifting token 'a' (1.1-1.1: <> printer for 'a' @ 1)
Entering state 1
Reading a token: Next token is token 'b' (1.2-1.2: 'b'/'c' printer for 'b' @ 2)
Shifting token 'b' (1.2-1.2: 'b'/'c' printer for 'b' @ 2)
Entering state 3
Reading a token: Next token is token 'c' (1.3-1.3: 'b'/'c' printer for 'c' @ 3)
Shifting token 'c' (1.3-1.3: 'b'/'c' printer for 'c' @ 3)
Entering state 5
Reading a token: Next token is token 'd' (1.4-1.4: <> printer for 'd' @ 4)
Shifting token 'd' (1.4-1.4: <> printer for 'd' @ 4)
Entering state 6
Reading a token: Now at end of input.
syntax error, unexpected \$end, expecting 'e'
Error: popping token 'd' (1.4-1.4: <> printer for 'd' @ 4)
Stack now 0 1 3 5
Error: popping token 'c' (1.3-1.3: 'b'/'c' printer for 'c' @ 3)
Stack now 0 1 3
Error: popping token 'b' (1.2-1.2: 'b'/'c' printer for 'b' @ 2)
Stack now 0 1
Error: popping token 'a' (1.1-1.1: <> printer for 'a' @ 1)
Stack now 0
Cleanup: discarding lookahead token \$end (1.5-1.5: )
Stack now 0
" | \
  $at_diff - "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "<> destructor for 'd' @ 4.
'b'/'c' destructor for 'c' @ 3.
'b'/'c' destructor for 'b' @ 2.
<> destructor for 'a' @ 1.
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:667"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_95
#AT_START_96
# 96. actions.at:709: Default tagged and per-type %printer and %destructor
at_setup_line='actions.at:709'
at_fn_banner 8
at_desc="Default tagged and per-type %printer and %destructor"
at_desc_line=" 96: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "96. actions.at:709: testing ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%error-verbose
%debug

%{
# include <stdio.h>
# include <stdlib.h>
  static void yyerror (const char *msg);
  static int yylex (void);
# define USE(SYM)
%}

%printer {
  fprintf (yyoutput, "<> printer should not be called.\n");
} <>

%union { int field0; int field1; int field2; }
%type <field0> start 'a' 'g'
%type <field1> 'e'
%type <field2> 'f'
%printer {
  fprintf (yyoutput, "<*>/<field2>/e printer");
} <*> 'e' <field2>
%destructor {
  fprintf (stdout, "<*>/<field2>/e destructor.\n");
} <*> 'e' <field2>

%type <field1> 'b'
%printer { fprintf (yyoutput, "<field1> printer"); } <field1>
%destructor { fprintf (stdout, "<field1> destructor.\n"); } <field1>

%type <field0> 'c'
%printer { fprintf (yyoutput, "'c' printer"); } 'c'
%destructor { fprintf (stdout, "'c' destructor.\n"); } 'c'

%type <field1> 'd'
%printer { fprintf (yyoutput, "'d' printer"); } 'd'
%destructor { fprintf (stdout, "'d' destructor.\n"); } 'd'

%destructor {
  fprintf (yyoutput, "<> destructor should not be called.\n");
} <>

%%

start:
  'a' 'b' 'c' 'd' 'e' 'f' 'g'
    {
      USE(($1, $2, $3, $4, $5, $6, $7));
      $$ = 'S';
    }
  ;

%%

static int
yylex (void)
{
  static char const input[] = "abcdef";
  static size_t toknum;
  if (! (toknum < sizeof input))
    abort ();
  return input[toknum++];
}

static void
yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}

int
main (void)
{
  yydebug = 1;
  return yyparse ();
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/actions.at:790: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:790"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:790"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:790: bison --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_trace "actions.at:790"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:790"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:790: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:790"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:790"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/actions.at:790: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:790"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:790"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/actions.at:790: bison -o input.c input.y"
at_fn_check_prepare_trace "actions.at:790"
( $at_check_trace; bison -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:790"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:791: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:791"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:791"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:792:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:792"
( $at_check_trace;  $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "Starting parse
Entering state 0
Reading a token: Next token is token 'a' (<*>/<field2>/e printer)
Shifting token 'a' (<*>/<field2>/e printer)
Entering state 1
Reading a token: Next token is token 'b' (<field1> printer)
Shifting token 'b' (<field1> printer)
Entering state 3
Reading a token: Next token is token 'c' ('c' printer)
Shifting token 'c' ('c' printer)
Entering state 5
Reading a token: Next token is token 'd' ('d' printer)
Shifting token 'd' ('d' printer)
Entering state 6
Reading a token: Next token is token 'e' (<*>/<field2>/e printer)
Shifting token 'e' (<*>/<field2>/e printer)
Entering state 7
Reading a token: Next token is token 'f' (<*>/<field2>/e printer)
Shifting token 'f' (<*>/<field2>/e printer)
Entering state 8
Reading a token: Now at end of input.
syntax error, unexpected \$end, expecting 'g'
Error: popping token 'f' (<*>/<field2>/e printer)
Stack now 0 1 3 5 6 7
Error: popping token 'e' (<*>/<field2>/e printer)
Stack now 0 1 3 5 6
Error: popping token 'd' ('d' printer)
Stack now 0 1 3 5
Error: popping token 'c' ('c' printer)
Stack now 0 1 3
Error: popping token 'b' (<field1> printer)
Stack now 0 1
Error: popping token 'a' (<*>/<field2>/e printer)
Stack now 0
Cleanup: discarding lookahead token \$end ()
Stack now 0
" | \
  $at_diff - "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "<*>/<field2>/e destructor.
<*>/<field2>/e destructor.
'd' destructor.
'c' destructor.
<field1> destructor.
<*>/<field2>/e destructor.
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:792"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_96
#AT_START_97
# 97. actions.at:846: Default %printer and %destructor for user-defined end token
at_setup_line='actions.at:846'
at_fn_banner 8
at_desc="Default %printer and %destructor for user-defined end token"
at_desc_line=" 97: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "97. actions.at:846: testing ..."
  $at_traceon


# _AT_CHECK_DEFAULT_PRINTER_AND_DESTRUCTOR_FOR_END_TOKEN(TYPED)
# -----------------------------------------------------------------------------




cat >input0.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%error-verbose
%debug
%locations
%initial-action {
  @$.first_line = @$.last_line = 1;
  @$.first_column = @$.last_column = 1;
}

%{
# include <stdio.h>
# include <stdlib.h>
  static void yyerror (const char *msg);
  static int yylex (void);
# define USE(SYM)
%}

%destructor {
  fprintf (yyoutput, "<*> destructor should not be called.\n");
} <*>

%token END 0
%printer {
  fprintf (yyoutput, "<> for '%c' @ %d", $$, @$.first_column);
} <>
%destructor {
  fprintf (stdout, "<> for '%c' @ %d.\n", $$, @$.first_column);
} <>

%printer {
  fprintf (yyoutput, "<*> printer should not be called.\n");
} <*>




%%

start: { $$ = 'S'; } ;

%%

static int
yylex (void)
{
  static int called;
  if (called++)
    abort ();
  yylval = 'E';
  yylloc.first_line = yylloc.last_line = 1;
  yylloc.first_column = yylloc.last_column = 1;
  return 0;
}

static void
yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}

int
main (void)
{
  yydebug = 1;
  return yyparse ();
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/actions.at:949: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input0.c input0.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:949"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input0.c input0.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:949"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:949: bison --xml=xml-tests/test.xml -o input0.c input0.y"
at_fn_check_prepare_trace "actions.at:949"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input0.c input0.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:949"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:949: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:949"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:949"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/actions.at:949: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:949"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:949"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/actions.at:949: bison -o input0.c input0.y"
at_fn_check_prepare_trace "actions.at:949"
( $at_check_trace; bison -o input0.c input0.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:949"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:949: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input0 input0.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input0 input0.c $LIBS" "actions.at:949"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input0 input0.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:949"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:949:  \$PREPARSER ./input0"
at_fn_check_prepare_dynamic " $PREPARSER ./input0" "actions.at:949"
( $at_check_trace;  $PREPARSER ./input0
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "Starting parse
Entering state 0
Reducing stack by rule 1 (line 46):
-> \$\$ = nterm start (1.1-1.1: <> for 'S' @ 1)
Stack now 0
Entering state 1
Reading a token: Now at end of input.
Shifting token END (1.1-1.1: <> for 'E' @ 1)
Entering state 2
Stack now 0 1 2
Cleanup: popping token END (1.1-1.1: <> for 'E' @ 1)
Cleanup: popping nterm start (1.1-1.1: <> for 'S' @ 1)
" | \
  $at_diff - "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "<> for 'E' @ 1.
<> for 'S' @ 1.
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:949"
$at_failed && at_fn_log_failure
$at_traceon; }







cat >input1.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%error-verbose
%debug
%locations
%initial-action {
  @$.first_line = @$.last_line = 1;
  @$.first_column = @$.last_column = 1;
}

%{
# include <stdio.h>
# include <stdlib.h>
  static void yyerror (const char *msg);
  static int yylex (void);
# define USE(SYM)
%}

%destructor {
  fprintf (yyoutput, "<> destructor should not be called.\n");
} <>

%token END 0
%printer {
  fprintf (yyoutput, "<*> for '%c' @ %d", $$, @$.first_column);
} <*>
%destructor {
  fprintf (stdout, "<*> for '%c' @ %d.\n", $$, @$.first_column);
} <*>

%printer {
  fprintf (yyoutput, "<> printer should not be called.\n");
} <>

%union { char tag; }
%type <tag> start END

%%

start: { $$ = 'S'; } ;

%%

static int
yylex (void)
{
  static int called;
  if (called++)
    abort ();
  yylval.tag = 'E';
  yylloc.first_line = yylloc.last_line = 1;
  yylloc.first_column = yylloc.last_column = 1;
  return 0;
}

static void
yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}

int
main (void)
{
  yydebug = 1;
  return yyparse ();
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/actions.at:950: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input1.c input1.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:950"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input1.c input1.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:950"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:950: bison --xml=xml-tests/test.xml -o input1.c input1.y"
at_fn_check_prepare_trace "actions.at:950"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input1.c input1.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:950"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:950: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:950"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:950"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/actions.at:950: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:950"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:950"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/actions.at:950: bison -o input1.c input1.y"
at_fn_check_prepare_trace "actions.at:950"
( $at_check_trace; bison -o input1.c input1.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:950"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:950: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input1 input1.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input1 input1.c $LIBS" "actions.at:950"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input1 input1.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:950"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:950:  \$PREPARSER ./input1"
at_fn_check_prepare_dynamic " $PREPARSER ./input1" "actions.at:950"
( $at_check_trace;  $PREPARSER ./input1
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "Starting parse
Entering state 0
Reducing stack by rule 1 (line 46):
-> \$\$ = nterm start (1.1-1.1: <*> for 'S' @ 1)
Stack now 0
Entering state 1
Reading a token: Now at end of input.
Shifting token END (1.1-1.1: <*> for 'E' @ 1)
Entering state 2
Stack now 0 1 2
Cleanup: popping token END (1.1-1.1: <*> for 'E' @ 1)
Cleanup: popping nterm start (1.1-1.1: <*> for 'S' @ 1)
" | \
  $at_diff - "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "<*> for 'E' @ 1.
<*> for 'S' @ 1.
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:950"
$at_failed && at_fn_log_failure
$at_traceon; }






  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_97
#AT_START_98
# 98. actions.at:960: Default %printer and %destructor are not for error or $undefined
at_setup_line='actions.at:960'
at_fn_banner 8
at_desc="Default %printer and %destructor are not for error or \$undefined"
at_desc_line=" 98: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "98. actions.at:960: testing ..."
  $at_traceon


# If Bison were to apply the default %printer and %destructor to the error
# token or to $undefined:
#   - For the error token:
#     - It would generate warnings for unused $n.
#     - It would invoke the %printer and %destructor on the error token's
#       semantic value, which would be initialized from the lookahead, which
#       would be destroyed separately.
#   - For $undefined, who knows what the semantic value would be.

cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug

%{
# include <stdio.h>
# include <stdlib.h>
  static void yyerror (const char *msg);
  static int yylex (void);
# define USE(SYM)
%}

%printer {
  fprintf (yyoutput, "'%c'", $$);
} <> <*>
%destructor {
  fprintf (stderr, "DESTROY '%c'\n", $$);
} <> <*>

%%

start:
  { $$ = 'S'; }
  /* In order to reveal the problems that this bug caused during parsing, add
   * $2 to USE.  */
  | 'a' error 'b' 'c' { USE(($1, $3, $4)); $$ = 'S'; }
  ;

%%

static int
yylex (void)
{
  static char const input[] = "abd";
  static size_t toknum;
  if (! (toknum < sizeof input))
    abort ();
  yylval = input[toknum++];
  return yylval;
}

static void
yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}

int
main (void)
{
  yydebug = 1;
  return yyparse ();
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/actions.at:1025: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1025"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1025"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:1025: bison --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_trace "actions.at:1025"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1025"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:1025: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1025"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1025"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/actions.at:1025: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1025"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1025"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/actions.at:1025: bison -o input.c input.y"
at_fn_check_prepare_trace "actions.at:1025"
( $at_check_trace; bison -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1025"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:1026: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:1026"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1026"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:1027:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:1027"
( $at_check_trace;  $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "Starting parse
Entering state 0
Reading a token: Next token is token 'a' ('a')
Shifting token 'a' ('a')
Entering state 1
Reading a token: Next token is token 'b' ('b')
syntax error
Shifting token error ()
Entering state 3
Next token is token 'b' ('b')
Shifting token 'b' ('b')
Entering state 5
Reading a token: Next token is token \$undefined ()
Error: popping token 'b' ('b')
DESTROY 'b'
Stack now 0 1 3
Error: popping token error ()
Stack now 0 1
Shifting token error ()
Entering state 3
Next token is token \$undefined ()
Error: discarding token \$undefined ()
Error: popping token error ()
Stack now 0 1
Shifting token error ()
Entering state 3
Reading a token: Now at end of input.
Cleanup: discarding lookahead token \$end ()
Stack now 0 1 3
Cleanup: popping token error ()
Cleanup: popping token 'a' ('a')
DESTROY 'a'
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1027"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_98
#AT_START_99
# 99. actions.at:1070: Default %printer and %destructor are not for $accept
at_setup_line='actions.at:1070'
at_fn_banner 8
at_desc="Default %printer and %destructor are not for \$accept"
at_desc_line=" 99: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "99. actions.at:1070: testing ..."
  $at_traceon


# If YYSTYPE is a union and Bison were to apply the default %printer and
# %destructor to $accept:
#   - The %printer and %destructor code generated for $accept would always be
#     dead code because $accept is currently never shifted onto the stack.
#   - $$ for $accept would always be of type YYSTYPE because it's not possible
#     to declare `%type <field> $accept'.  (Also true for $undefined.)
#   - Thus, the compiler might complain that the user code assumes the wrong
#     type for $$ since the code might assume the type associated with a
#     specific union field, which is especially reasonable in C++ since that
#     type may be a base type.  This test case checks for this problem.  (Also
#     true for $undefined and the error token, so there are three warnings for
#     %printer and three for %destructor.)

cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug /* So that %printer is actually compiled.  */

%{
# include <stdio.h>
# include <stdlib.h>
  static void yyerror (const char *msg);
  static int yylex (void);
# define USE(SYM)
%}

%printer {
  char chr = $$;
  fprintf (yyoutput, "'%c'", chr);
} <> <*>
%destructor {
  char chr = $$;
  fprintf (stderr, "DESTROY '%c'\n", chr);
} <> <*>

%union { char chr; }
%type <chr> start

%%

start: { USE($$); } ;

%%

static int
yylex (void)
{
  static int called;
  if (called++)
    abort ();
  return 0;
}

static void
yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}

int
main (void)
{
  return yyparse ();
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/actions.at:1136: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1136"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1136"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:1136: bison --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_trace "actions.at:1136"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1136"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:1136: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1136"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1136"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/actions.at:1136: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1136"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1136"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/actions.at:1136: bison -o input.c input.y"
at_fn_check_prepare_trace "actions.at:1136"
( $at_check_trace; bison -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1136"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:1137: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:1137"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1137"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_99
#AT_START_100
# 100. actions.at:1147: Default %printer and %destructor for mid-rule values
at_setup_line='actions.at:1147'
at_fn_banner 8
at_desc="Default %printer and %destructor for mid-rule values"
at_desc_line="100: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "100. actions.at:1147: testing ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%debug /* So that %printer is actually compiled.  */

%{
# include <stdio.h>
# include <stdlib.h>
  static void yyerror (const char *msg);
  static int yylex (void);
# define USE(SYM)
# define YYLTYPE int
# define YYLLOC_DEFAULT(Current, Rhs, N)
# define YY_LOCATION_PRINT(File, Loc)
%}

%printer { fprintf (yyoutput, "%d", @$); } <>
%destructor { fprintf (stderr, "DESTROY %d\n", @$); } <>
%printer { fprintf (yyoutput, "<*> printer should not be called"); } <*>
%destructor { fprintf (yyoutput, "<*> destructor should not be called"); } <*>

%%

start:
  {           @$ = 1; } // Not set or used.
  { USE ($$); @$ = 2; } // Both set and used.
  { USE ($$); @$ = 3; } // Only set.
  {           @$ = 4; } // Only used.
  'c'
  { USE (($$, $2, $4, $5)); @$ = 0; }
  ;

%%

static int
yylex (void)
{
  static int called;
  if (called++)
    abort ();
  return 0;
}

static void
yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}

int
main (void)
{
  yydebug = 1;
  return yyparse ();
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/actions.at:1204: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1204"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1204"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:1204: bison --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_trace "actions.at:1204"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1204"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:1204: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1204"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1204"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/actions.at:1204: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1204"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1204"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/actions.at:1204: bison -o input.c input.y"
at_fn_check_prepare_trace "actions.at:1204"
( $at_check_trace; bison -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:33.3-23: warning: unset value: \$\$
input.y:30.3-35.37: warning: unused value: \$3
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1204"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/actions.at:1209: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:1209"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1209"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:1210:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:1210"
( $at_check_trace;  $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "Starting parse
Entering state 0
Reducing stack by rule 1 (line 30):
-> \$\$ = nterm \$@1 (: )
Stack now 0
Entering state 2
Reducing stack by rule 2 (line 31):
-> \$\$ = nterm @2 (: 2)
Stack now 0 2
Entering state 4
Reducing stack by rule 3 (line 32):
-> \$\$ = nterm @3 (: 3)
Stack now 0 2 4
Entering state 5
Reducing stack by rule 4 (line 33):
-> \$\$ = nterm @4 (: 4)
Stack now 0 2 4 5
Entering state 6
Reading a token: Now at end of input.
syntax error
Error: popping nterm @4 (: 4)
DESTROY 4
Stack now 0 2 4 5
Error: popping nterm @3 (: 3)
DESTROY 3
Stack now 0 2 4
Error: popping nterm @2 (: 2)
DESTROY 2
Stack now 0 2
Error: popping nterm \$@1 (: )
Stack now 0
Cleanup: discarding lookahead token \$end (: )
Stack now 0
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1210"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_100
#AT_START_101
# 101. actions.at:1303: @$ in %initial-action implies %locations
at_setup_line='actions.at:1303'
at_fn_banner 8
at_desc="@\$ in %initial-action implies %locations"
at_desc_line="101: $at_desc       "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "101. actions.at:1303: testing ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code {
  #include <stdio.h>
  static int yylex (void);
  static void yyerror (char const *msg);
}

%debug

%initial-action {
  printf ("%d\n", @$.first_line);
}

%%

start:  ;

%%

static int
yylex (void)
{
  return 0;
}

static void
yyerror (char const *msg)
{
  fprintf (stderr, "%s\n", msg);
}

int
main (void)
{
  return yyparse ();
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/actions.at:1303: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1303"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1303"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:1303: bison --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_trace "actions.at:1303"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1303"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:1303: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1303"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1303"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/actions.at:1303: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1303"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1303"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/actions.at:1303: bison -o input.c input.y"
at_fn_check_prepare_trace "actions.at:1303"
( $at_check_trace; bison -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1303"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:1303: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:1303"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1303"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_101
#AT_START_102
# 102. actions.at:1304: @$ in %destructor implies %locations
at_setup_line='actions.at:1304'
at_fn_banner 8
at_desc="@\$ in %destructor implies %locations"
at_desc_line="102: $at_desc           "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "102. actions.at:1304: testing ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code {
  #include <stdio.h>
  static int yylex (void);
  static void yyerror (char const *msg);
}

%debug

%destructor {
  printf ("%d\n", @$.first_line);
} start

%%

start:  ;

%%

static int
yylex (void)
{
  return 0;
}

static void
yyerror (char const *msg)
{
  fprintf (stderr, "%s\n", msg);
}

int
main (void)
{
  return yyparse ();
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/actions.at:1304: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1304"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1304"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:1304: bison --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_trace "actions.at:1304"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1304"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:1304: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1304"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1304"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/actions.at:1304: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1304"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1304"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/actions.at:1304: bison -o input.c input.y"
at_fn_check_prepare_trace "actions.at:1304"
( $at_check_trace; bison -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1304"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:1304: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:1304"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1304"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_102
#AT_START_103
# 103. actions.at:1305: @$ in %printer implies %locations
at_setup_line='actions.at:1305'
at_fn_banner 8
at_desc="@\$ in %printer implies %locations"
at_desc_line="103: $at_desc              "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "103. actions.at:1305: testing ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%code {
  #include <stdio.h>
  static int yylex (void);
  static void yyerror (char const *msg);
}

%debug

%printer {
  printf ("%d\n", @$.first_line);
} start

%%

start:  ;

%%

static int
yylex (void)
{
  return 0;
}

static void
yyerror (char const *msg)
{
  fprintf (stderr, "%s\n", msg);
}

int
main (void)
{
  return yyparse ();
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/actions.at:1305: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1305"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1305"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/actions.at:1305: bison --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_trace "actions.at:1305"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1305"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/actions.at:1305: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1305"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1305"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/actions.at:1305: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1305"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1305"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/actions.at:1305: bison -o input.c input.y"
at_fn_check_prepare_trace "actions.at:1305"
( $at_check_trace; bison -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1305"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/actions.at:1305: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:1305"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1305"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_103
#AT_START_104
# 104. conflicts.at:31: S/R in initial
at_setup_line='conflicts.at:31'
at_fn_banner 9
at_desc="S/R in initial"
at_desc_line="104: $at_desc                                 "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "104. conflicts.at:31: testing ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%expect 1
%%
exp: e 'e';
e: 'e' | /* Nothing. */;
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/conflicts.at:40: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:40"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:40"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:40: bison --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:40"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:40"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:40: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:40"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:40"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:40: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:40"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:40"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:40: bison -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:40"
( $at_check_trace; bison -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:4.9: warning: rule useless in parser due to conflicts: e: /* empty */
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:40"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_104
#AT_START_105
# 105. conflicts.at:51: %nonassoc and eof
at_setup_line='conflicts.at:51'
at_fn_banner 9
at_desc="%nonassoc and eof"
at_desc_line="105: $at_desc                              "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "105. conflicts.at:51: testing ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%{
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define YYERROR_VERBOSE 1
static void
yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}

/* The current argument. */
static const char *input;

static int
yylex (void)
{
  static size_t toknum;
  if (! (toknum <= strlen (input)))
    abort ();
  return input[toknum++];
}

%}

%nonassoc '<' '>'

%%
expr: expr '<' expr
    | expr '>' expr
    | '0'
    ;
%%
int
main (int argc, const char *argv[])
{
  input = argc <= 1 ? "" : argv[1];
  return yyparse ();
}
_ATEOF



# Specify the output files to avoid problems on different file systems.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/conflicts.at:98: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:98"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:98"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:98: bison --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:98"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:98"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:98: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:98"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:98"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:98: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:98"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:98"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:98: bison -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:98"
( $at_check_trace; bison -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:98"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:99: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:99"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:99"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/conflicts.at:101:  \$PREPARSER ./input '0<0'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0'" "conflicts.at:101"
( $at_check_trace;  $PREPARSER ./input '0<0'
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:101"
$at_failed && at_fn_log_failure
$at_traceon; }

# FIXME: This is an actual bug, but a new one, in the sense that
# no one has ever spotted it!  The messages are *wrong*: there should
# be nothing there, it should be expected eof.
{ set +x
$as_echo "$at_srcdir/conflicts.at:105:  \$PREPARSER ./input '0<0<0'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0<0'" "conflicts.at:105"
( $at_check_trace;  $PREPARSER ./input '0<0<0'
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "syntax error, unexpected '<', expecting '<' or '>'
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:105"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/conflicts.at:109:  \$PREPARSER ./input '0>0'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0'" "conflicts.at:109"
( $at_check_trace;  $PREPARSER ./input '0>0'
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:109"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:110:  \$PREPARSER ./input '0>0>0'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0>0'" "conflicts.at:110"
( $at_check_trace;  $PREPARSER ./input '0>0>0'
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "syntax error, unexpected '>', expecting '<' or '>'
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:110"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/conflicts.at:114:  \$PREPARSER ./input '0<0>0'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0>0'" "conflicts.at:114"
( $at_check_trace;  $PREPARSER ./input '0<0>0'
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "syntax error, unexpected '>', expecting '<' or '>'
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:114"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_105
#AT_START_106
# 106. conflicts.at:126: Unresolved SR Conflicts
at_setup_line='conflicts.at:126'
at_fn_banner 9
at_desc="Unresolved SR Conflicts"
at_desc_line="106: $at_desc                        "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "106. conflicts.at:126: testing ..."
  $at_traceon




cat >input.y <<'_ATEOF'
%token NUM OP
%%
exp: exp OP exp | NUM;
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/conflicts.at:136: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c --report=all input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:136"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c --report=all input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:136"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:136: bison --xml=xml-tests/test.xml -o input.c --report=all input.y"
at_fn_check_prepare_trace "conflicts.at:136"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.c --report=all input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:136"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:136: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:136"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:136"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:136: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:136"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:136"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:136: bison -o input.c --report=all input.y"
at_fn_check_prepare_trace "conflicts.at:136"
( $at_check_trace; bison -o input.c --report=all input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y: conflicts: 1 shift/reduce
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:136"
$at_failed && at_fn_log_failure
$at_traceon; }


# Check the contents of the report.
{ set +x
$as_echo "$at_srcdir/conflicts.at:141: cat input.output"
at_fn_check_prepare_trace "conflicts.at:141"
( $at_check_trace; cat input.output
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "State 5 conflicts: 1 shift/reduce


Grammar

    0 \$accept: exp \$end

    1 exp: exp OP exp
    2    | NUM


Terminals, with rules where they appear

\$end (0) 0
error (256)
NUM (258) 2
OP (259) 1


Nonterminals, with rules where they appear

\$accept (5)
    on left: 0
exp (6)
    on left: 1 2, on right: 0 1


state 0

    0 \$accept: . exp \$end
    1 exp: . exp OP exp
    2    | . NUM

    NUM  shift, and go to state 1

    exp  go to state 2


state 1

    2 exp: NUM .

    \$default  reduce using rule 2 (exp)


state 2

    0 \$accept: exp . \$end
    1 exp: exp . OP exp

    \$end  shift, and go to state 3
    OP    shift, and go to state 4


state 3

    0 \$accept: exp \$end .

    \$default  accept


state 4

    1 exp: . exp OP exp
    1    | exp OP . exp
    2    | . NUM

    NUM  shift, and go to state 1

    exp  go to state 5


state 5

    1 exp: exp . OP exp
    1    | exp OP exp .  [\$end, OP]

    OP  shift, and go to state 4

    OP        [reduce using rule 1 (exp)]
    \$default  reduce using rule 1 (exp)
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:141"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_106
#AT_START_107
# 107. conflicts.at:233: Resolved SR Conflicts
at_setup_line='conflicts.at:233'
at_fn_banner 9
at_desc="Resolved SR Conflicts"
at_desc_line="107: $at_desc                          "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "107. conflicts.at:233: testing ..."
  $at_traceon




cat >input.y <<'_ATEOF'
%token NUM OP
%left OP
%%
exp: exp OP exp | NUM;
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/conflicts.at:244: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c --report=all input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:244"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c --report=all input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:244"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:244: bison --xml=xml-tests/test.xml -o input.c --report=all input.y"
at_fn_check_prepare_trace "conflicts.at:244"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.c --report=all input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:244"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:244: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:244"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:244"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:244: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:244"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:244"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:244: bison -o input.c --report=all input.y"
at_fn_check_prepare_trace "conflicts.at:244"
( $at_check_trace; bison -o input.c --report=all input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:244"
$at_failed && at_fn_log_failure
$at_traceon; }


# Check the contents of the report.
{ set +x
$as_echo "$at_srcdir/conflicts.at:247: cat input.output"
at_fn_check_prepare_trace "conflicts.at:247"
( $at_check_trace; cat input.output
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "Grammar

    0 \$accept: exp \$end

    1 exp: exp OP exp
    2    | NUM


Terminals, with rules where they appear

\$end (0) 0
error (256)
NUM (258) 2
OP (259) 1


Nonterminals, with rules where they appear

\$accept (5)
    on left: 0
exp (6)
    on left: 1 2, on right: 0 1


state 0

    0 \$accept: . exp \$end
    1 exp: . exp OP exp
    2    | . NUM

    NUM  shift, and go to state 1

    exp  go to state 2


state 1

    2 exp: NUM .

    \$default  reduce using rule 2 (exp)


state 2

    0 \$accept: exp . \$end
    1 exp: exp . OP exp

    \$end  shift, and go to state 3
    OP    shift, and go to state 4


state 3

    0 \$accept: exp \$end .

    \$default  accept


state 4

    1 exp: . exp OP exp
    1    | exp OP . exp
    2    | . NUM

    NUM  shift, and go to state 1

    exp  go to state 5


state 5

    1 exp: exp . OP exp
    1    | exp OP exp .  [\$end, OP]

    \$default  reduce using rule 1 (exp)

    Conflict between rule 1 and token OP resolved as reduce (%left OP).
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:247"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_107
#AT_START_108
# 108. conflicts.at:355: Defaulted Conflicted Reduction
at_setup_line='conflicts.at:355'
at_fn_banner 9
at_desc="Defaulted Conflicted Reduction"
at_desc_line="108: $at_desc                 "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "108. conflicts.at:355: testing ..."
  $at_traceon



cat >input.y <<'_ATEOF'
%%
exp: num | id;
num: '0';
id : '0';
%%
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/conflicts.at:366: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c --report=all input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:366"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c --report=all input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:366"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:366: bison --xml=xml-tests/test.xml -o input.c --report=all input.y"
at_fn_check_prepare_trace "conflicts.at:366"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.c --report=all input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:366"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:366: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:366"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:366"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:366: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:366"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:366"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:366: bison -o input.c --report=all input.y"
at_fn_check_prepare_trace "conflicts.at:366"
( $at_check_trace; bison -o input.c --report=all input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y: conflicts: 1 reduce/reduce
input.y:4.6-8: warning: rule useless in parser due to conflicts: id: '0'
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:366"
$at_failed && at_fn_log_failure
$at_traceon; }


# Check the contents of the report.
{ set +x
$as_echo "$at_srcdir/conflicts.at:372: cat input.output"
at_fn_check_prepare_trace "conflicts.at:372"
( $at_check_trace; cat input.output
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "Rules useless in parser due to conflicts

    4 id: '0'


State 1 conflicts: 1 reduce/reduce


Grammar

    0 \$accept: exp \$end

    1 exp: num
    2    | id

    3 num: '0'

    4 id: '0'


Terminals, with rules where they appear

\$end (0) 0
'0' (48) 3 4
error (256)


Nonterminals, with rules where they appear

\$accept (4)
    on left: 0
exp (5)
    on left: 1 2, on right: 0
num (6)
    on left: 3, on right: 1
id (7)
    on left: 4, on right: 2


state 0

    0 \$accept: . exp \$end
    1 exp: . num
    2    | . id
    3 num: . '0'
    4 id: . '0'

    '0'  shift, and go to state 1

    exp  go to state 2
    num  go to state 3
    id   go to state 4


state 1

    3 num: '0' .  [\$end]
    4 id: '0' .  [\$end]

    \$end      reduce using rule 3 (num)
    \$end      [reduce using rule 4 (id)]
    \$default  reduce using rule 3 (num)


state 2

    0 \$accept: exp . \$end

    \$end  shift, and go to state 5


state 3

    1 exp: num .

    \$default  reduce using rule 1 (exp)


state 4

    2 exp: id .

    \$default  reduce using rule 2 (exp)


state 5

    0 \$accept: exp \$end .

    \$default  accept
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_108
#AT_START_109
# 109. conflicts.at:474: %expect not enough
at_setup_line='conflicts.at:474'
at_fn_banner 9
at_desc="%expect not enough"
at_desc_line="109: $at_desc                             "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "109. conflicts.at:474: testing ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%token NUM OP
%expect 0
%%
exp: exp OP exp | NUM;
_ATEOF



{ set +x
$as_echo "$at_srcdir/conflicts.at:483: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y" "conflicts.at:483"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y: conflicts: 1 shift/reduce
input.y: expected 0 shift/reduce conflicts
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:483"
$at_failed && at_fn_log_failure
$at_traceon; }

  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_109
#AT_START_110
# 110. conflicts.at:494: %expect right
at_setup_line='conflicts.at:494'
at_fn_banner 9
at_desc="%expect right"
at_desc_line="110: $at_desc                                  "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "110. conflicts.at:494: testing ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%token NUM OP
%expect 1
%%
exp: exp OP exp | NUM;
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/conflicts.at:503: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:503"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:503"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:503: bison --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:503"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:503"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:503: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:503"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:503"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:503: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:503"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:503"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:503: bison -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:503"
( $at_check_trace; bison -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:503"
$at_failed && at_fn_log_failure
$at_traceon; }

  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_110
#AT_START_111
# 111. conflicts.at:511: %expect too much
at_setup_line='conflicts.at:511'
at_fn_banner 9
at_desc="%expect too much"
at_desc_line="111: $at_desc                               "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "111. conflicts.at:511: testing ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%token NUM OP
%expect 2
%%
exp: exp OP exp | NUM;
_ATEOF



{ set +x
$as_echo "$at_srcdir/conflicts.at:520: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y" "conflicts.at:520"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y: conflicts: 1 shift/reduce
input.y: expected 2 shift/reduce conflicts
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:520"
$at_failed && at_fn_log_failure
$at_traceon; }

  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_111
#AT_START_112
# 112. conflicts.at:531: %expect with reduce conflicts
at_setup_line='conflicts.at:531'
at_fn_banner 9
at_desc="%expect with reduce conflicts"
at_desc_line="112: $at_desc                  "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "112. conflicts.at:531: testing ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%expect 0
%%
program: a 'a' | a a;
a: 'a';
_ATEOF



{ set +x
$as_echo "$at_srcdir/conflicts.at:540: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o input.c input.y" "conflicts.at:540"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y: conflicts: 1 reduce/reduce
input.y: expected 0 reduce/reduce conflicts
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:540"
$at_failed && at_fn_log_failure
$at_traceon; }

  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_112
#AT_START_113
# 113. conflicts.at:551: %no-default-prec without %prec
at_setup_line='conflicts.at:551'
at_fn_banner 9
at_desc="%no-default-prec without %prec"
at_desc_line="113: $at_desc                 "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "113. conflicts.at:551: testing ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%left '+'
%left '*'

%%

%no-default-prec;

e:   e '+' e
   | e '*' e
   | '0'
   ;
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/conflicts.at:567: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:567"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:567"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:567: bison --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:567"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:567"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:567: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:567"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:567"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:567: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:567"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:567"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:567: bison -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:567"
( $at_check_trace; bison -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y: conflicts: 4 shift/reduce
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:567"
$at_failed && at_fn_log_failure
$at_traceon; }

  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_113
#AT_START_114
# 114. conflicts.at:577: %no-default-prec with %prec
at_setup_line='conflicts.at:577'
at_fn_banner 9
at_desc="%no-default-prec with %prec"
at_desc_line="114: $at_desc                    "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "114. conflicts.at:577: testing ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%left '+'
%left '*'

%%

%no-default-prec;

e:   e '+' e %prec '+'
   | e '*' e %prec '*'
   | '0'
   ;
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/conflicts.at:593: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:593"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:593"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:593: bison --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:593"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:593"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:593: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:593"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:593"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:593: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:593"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:593"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:593: bison -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:593"
( $at_check_trace; bison -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:593"
$at_failed && at_fn_log_failure
$at_traceon; }

  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_114
#AT_START_115
# 115. conflicts.at:601: %default-prec
at_setup_line='conflicts.at:601'
at_fn_banner 9
at_desc="%default-prec"
at_desc_line="115: $at_desc                                  "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "115. conflicts.at:601: testing ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%left '+'
%left '*'

%%

%default-prec;

e:   e '+' e
   | e '*' e
   | '0'
   ;
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/conflicts.at:617: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:617"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:617"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:617: bison --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:617"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:617"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:617: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:617"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:617"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:617: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:617"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:617"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:617: bison -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:617"
( $at_check_trace; bison -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:617"
$at_failed && at_fn_log_failure
$at_traceon; }

  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_115
#AT_START_116
# 116. conflicts.at:625: Unreachable States After Conflict Resolution
at_setup_line='conflicts.at:625'
at_fn_banner 9
at_desc="Unreachable States After Conflict Resolution"
at_desc_line="116: $at_desc   "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "116. conflicts.at:625: testing ..."
  $at_traceon


# If conflict resolution makes states unreachable, remove those states, report
# rules that are then unused, and don't report conflicts in those states.  Test
# what happens when a nonterminal becomes useless as a result of state removal
# since that causes lalr.o's goto map to be rewritten.

cat >input.y <<'_ATEOF'
%output "input.c"
%left 'a'

%%

start: resolved_conflict 'a' reported_conflicts 'a' ;

/* S/R conflict resolved as reduce, so the state with item
 * (resolved_conflict: 'a' . unreachable1) and all it transition successors are
 * unreachable, and the associated production is useless.  */
resolved_conflict:
    'a' unreachable1
  | %prec 'a'
  ;

/* S/R conflict that need not be reported since it is unreachable because of
 * the previous conflict resolution.  Nonterminal unreachable1 and all its
 * productions are useless.  */
unreachable1:
    'a' unreachable2
  |
  ;

/* Likewise for a R/R conflict and nonterminal unreachable2.  */
unreachable2: | ;

/* Make sure remaining S/R and R/R conflicts are still reported correctly even
 * when their states are renumbered due to state removal.  */
reported_conflicts:
    'a'
  | 'a'
  |
  ;

_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/conflicts.at:669: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot --report=all input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:669"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot --report=all input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:669"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:669: bison --xml=xml-tests/test.xml --report=all input.y"
at_fn_check_prepare_trace "conflicts.at:669"
( $at_check_trace; bison --xml=xml-tests/test.xml --report=all input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:669"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:669: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:669"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:669"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:669: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:669"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:669"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:669: bison --report=all input.y"
at_fn_check_prepare_trace "conflicts.at:669"
( $at_check_trace; bison --report=all input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y: conflicts: 1 shift/reduce, 1 reduce/reduce
input.y:12.5-20: warning: rule useless in parser due to conflicts: resolved_conflict: 'a' unreachable1
input.y:20.5-20: warning: rule useless in parser due to conflicts: unreachable1: 'a' unreachable2
input.y:21.4: warning: rule useless in parser due to conflicts: unreachable1: /* empty */
input.y:25.13: warning: rule useless in parser due to conflicts: unreachable2: /* empty */
input.y:25.16: warning: rule useless in parser due to conflicts: unreachable2: /* empty */
input.y:31.5-7: warning: rule useless in parser due to conflicts: reported_conflicts: 'a'
input.y:32.4: warning: rule useless in parser due to conflicts: reported_conflicts: /* empty */
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:669"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/conflicts.at:680: cat input.output"
at_fn_check_prepare_trace "conflicts.at:680"
( $at_check_trace; cat input.output
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "Rules useless in parser due to conflicts

    2 resolved_conflict: 'a' unreachable1

    4 unreachable1: 'a' unreachable2
    5             | /* empty */

    6 unreachable2: /* empty */
    7             | /* empty */

    9 reported_conflicts: 'a'
   10                   | /* empty */


State 4 conflicts: 1 shift/reduce
State 5 conflicts: 1 reduce/reduce


Grammar

    0 \$accept: start \$end

    1 start: resolved_conflict 'a' reported_conflicts 'a'

    2 resolved_conflict: 'a' unreachable1
    3                  | /* empty */

    4 unreachable1: 'a' unreachable2
    5             | /* empty */

    6 unreachable2: /* empty */
    7             | /* empty */

    8 reported_conflicts: 'a'
    9                   | 'a'
   10                   | /* empty */


Terminals, with rules where they appear

\$end (0) 0
'a' (97) 1 2 4 8 9
error (256)


Nonterminals, with rules where they appear

\$accept (4)
    on left: 0
start (5)
    on left: 1, on right: 0
resolved_conflict (6)
    on left: 2 3, on right: 1
unreachable1 (7)
    on left: 4 5, on right: 2
unreachable2 (8)
    on left: 6 7, on right: 4
reported_conflicts (9)
    on left: 8 9 10, on right: 1


state 0

    0 \$accept: . start \$end
    1 start: . resolved_conflict 'a' reported_conflicts 'a'
    2 resolved_conflict: . 'a' unreachable1
    3                  | .  ['a']

    \$default  reduce using rule 3 (resolved_conflict)

    start              go to state 1
    resolved_conflict  go to state 2

    Conflict between rule 3 and token 'a' resolved as reduce (%left 'a').


state 1

    0 \$accept: start . \$end

    \$end  shift, and go to state 3


state 2

    1 start: resolved_conflict . 'a' reported_conflicts 'a'

    'a'  shift, and go to state 4


state 3

    0 \$accept: start \$end .

    \$default  accept


state 4

    1 start: resolved_conflict 'a' . reported_conflicts 'a'
    8 reported_conflicts: . 'a'
    9                   | . 'a'
   10                   | .  ['a']

    'a'  shift, and go to state 5

    'a'  [reduce using rule 10 (reported_conflicts)]

    reported_conflicts  go to state 6


state 5

    8 reported_conflicts: 'a' .  ['a']
    9                   | 'a' .  ['a']

    'a'       reduce using rule 8 (reported_conflicts)
    'a'       [reduce using rule 9 (reported_conflicts)]
    \$default  reduce using rule 8 (reported_conflicts)


state 6

    1 start: resolved_conflict 'a' reported_conflicts . 'a'

    'a'  shift, and go to state 7


state 7

    1 start: resolved_conflict 'a' reported_conflicts 'a' .

    \$default  reduce using rule 1 (start)
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:680"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input-keep.y <<'_ATEOF'
%define lr.keep_unreachable_states
_ATEOF

{ set +x
$as_echo "$at_srcdir/conflicts.at:819: cat input.y >> input-keep.y"
at_fn_check_prepare_trace "conflicts.at:819"
( $at_check_trace; cat input.y >> input-keep.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:819"
$at_failed && at_fn_log_failure
$at_traceon; }


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/conflicts.at:821: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot input-keep.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:821"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot input-keep.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:821"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:821: bison --xml=xml-tests/test.xml input-keep.y"
at_fn_check_prepare_trace "conflicts.at:821"
( $at_check_trace; bison --xml=xml-tests/test.xml input-keep.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:821"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:821: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:821"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:821"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:821: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:821"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:821"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:821: bison input-keep.y"
at_fn_check_prepare_trace "conflicts.at:821"
( $at_check_trace; bison input-keep.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input-keep.y: conflicts: 2 shift/reduce, 2 reduce/reduce
input-keep.y:22.4: warning: rule useless in parser due to conflicts: unreachable1: /* empty */
input-keep.y:26.16: warning: rule useless in parser due to conflicts: unreachable2: /* empty */
input-keep.y:32.5-7: warning: rule useless in parser due to conflicts: reported_conflicts: 'a'
input-keep.y:33.4: warning: rule useless in parser due to conflicts: reported_conflicts: /* empty */
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:821"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_116
#AT_START_117
# 117. conflicts.at:836: Solved conflicts report for multiple reductions in a state
at_setup_line='conflicts.at:836'
at_fn_banner 9
at_desc="Solved conflicts report for multiple reductions in a state"
at_desc_line="117: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "117. conflicts.at:836: testing ..."
  $at_traceon


# Used to lose earlier solved conflict messages even within a single S/R/R.

cat >input.y <<'_ATEOF'
%left 'a'
%right 'b'
%right 'c'
%right 'd'
%%
start:
    'a'
  | empty_a 'a'
  | 'b'
  | empty_b 'b'
  | 'c'
  | empty_c1 'c'
  | empty_c2 'c'
  | empty_c3 'c'
  ;
empty_a: %prec 'a' ;
empty_b: %prec 'b' ;
empty_c1: %prec 'c' ;
empty_c2: %prec 'c' ;
empty_c3: %prec 'd' ;
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/conflicts.at:862: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot --report=all -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:862"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot --report=all -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:862"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:862: bison --xml=xml-tests/test.xml --report=all -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:862"
( $at_check_trace; bison --xml=xml-tests/test.xml --report=all -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:862"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:862: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:862"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:862"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:862: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:862"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:862"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:862: bison --report=all -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:862"
( $at_check_trace; bison --report=all -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:862"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:863: cat input.output | sed -n '/^state 0\$/,/^state 1\$/p'"
at_fn_check_prepare_dynamic "cat input.output | sed -n '/^state 0$/,/^state 1$/p'" "conflicts.at:863"
( $at_check_trace; cat input.output | sed -n '/^state 0$/,/^state 1$/p'
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "state 0

    0 \$accept: . start \$end
    1 start: . 'a'
    2      | . empty_a 'a'
    3      | . 'b'
    4      | . empty_b 'b'
    5      | . 'c'
    6      | . empty_c1 'c'
    7      | . empty_c2 'c'
    8      | . empty_c3 'c'
    9 empty_a: .  ['a']
   10 empty_b: .  []
   11 empty_c1: .  []
   12 empty_c2: .  []
   13 empty_c3: .  ['c']

    'b'  shift, and go to state 1

    'c'       reduce using rule 13 (empty_c3)
    \$default  reduce using rule 9 (empty_a)

    start     go to state 2
    empty_a   go to state 3
    empty_b   go to state 4
    empty_c1  go to state 5
    empty_c2  go to state 6
    empty_c3  go to state 7

    Conflict between rule 9 and token 'a' resolved as reduce (%left 'a').
    Conflict between rule 10 and token 'b' resolved as shift (%right 'b').
    Conflict between rule 11 and token 'c' resolved as shift (%right 'c').
    Conflict between rule 12 and token 'c' resolved as shift (%right 'c').
    Conflict between rule 13 and token 'c' resolved as reduce ('c' < 'd').


state 1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:863"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_117
#AT_START_118
# 118. conflicts.at:916: %nonassoc error actions for multiple reductions in a state
at_setup_line='conflicts.at:916'
at_fn_banner 9
at_desc="%nonassoc error actions for multiple reductions in a state"
at_desc_line="118: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "118. conflicts.at:916: testing ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%nonassoc 'a' 'b' 'c'
%%
start:
    'a'
  | empty_a 'a'
  | 'b'
  | empty_b 'b'
  | 'c'
  | empty_c1 'c'
  | empty_c2 'c'
  | empty_c3 'c'
  ;
empty_a: %prec 'a' ;
empty_b: %prec 'b' ;
empty_c1: %prec 'c' ;
empty_c2: %prec 'c' ;
empty_c3: %prec 'c' ;
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/conflicts.at:938: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot --report=all -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:938"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot --report=all -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:938"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/conflicts.at:938: bison --xml=xml-tests/test.xml --report=all -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:938"
( $at_check_trace; bison --xml=xml-tests/test.xml --report=all -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:938"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:938: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:938"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:938"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/conflicts.at:938: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:938"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:938"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/conflicts.at:938: bison --report=all -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:938"
( $at_check_trace; bison --report=all -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:938"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/conflicts.at:939: cat input.output | sed -n '/^state 0\$/,/^state 1\$/p'"
at_fn_check_prepare_dynamic "cat input.output | sed -n '/^state 0$/,/^state 1$/p'" "conflicts.at:939"
( $at_check_trace; cat input.output | sed -n '/^state 0$/,/^state 1$/p'
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "state 0

    0 \$accept: . start \$end
    1 start: . 'a'
    2      | . empty_a 'a'
    3      | . 'b'
    4      | . empty_b 'b'
    5      | . 'c'
    6      | . empty_c1 'c'
    7      | . empty_c2 'c'
    8      | . empty_c3 'c'
    9 empty_a: .  []
   10 empty_b: .  []
   11 empty_c1: .  []
   12 empty_c2: .  ['c']
   13 empty_c3: .  ['c']

    'a'  error (nonassociative)
    'b'  error (nonassociative)
    'c'  error (nonassociative)

    'c'  [reduce using rule 12 (empty_c2)]
    'c'  [reduce using rule 13 (empty_c3)]

    start     go to state 1
    empty_a   go to state 2
    empty_b   go to state 3
    empty_c1  go to state 4
    empty_c2  go to state 5
    empty_c3  go to state 6

    Conflict between rule 9 and token 'a' resolved as an error (%nonassoc 'a').
    Conflict between rule 10 and token 'b' resolved as an error (%nonassoc 'b').
    Conflict between rule 11 and token 'c' resolved as an error (%nonassoc 'c').


state 1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:939"
$at_failed && at_fn_log_failure
$at_traceon; }

  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_118
#AT_START_119
# 119. calc.at:568: Calculator
at_setup_line='calc.at:568'
at_fn_banner 10
at_desc="Calculator "
at_desc_line="119: $at_desc                                    "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "119. calc.at:568: testing ..."
  $at_traceon









# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.














cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */


%code requires {
/* Exercise pre-prologue dependency to %union.  */
typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};

%code provides {
#include <stdio.h>
/* The input.  */
extern FILE *input;
}

%code {
#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#else
# undef alarm
# define alarm(seconds) /* empty */
#endif
#define USE(Var)

FILE *input;
static semantic_value global_result = 0;
static int global_count = 0;
static int power (int base, int exponent);
/* yyerror receives the location if:
   - %location & %pure & %glr
   - %location & %pure & %yacc & %parse-param. */
static void yyerror (

                     const char *s
                     );
int yylex (void);
}



/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type  <ival> exp

%nonassoc '=' /* comparison	       */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line         {  }
;

line:
  '\n'
| exp '\n'           { USE ($1); }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static void
yyerror (

         const char *s)
{


  fprintf (stderr, "%s\n", s);
}

#include <ctype.h>

int yylex (void);
static int get_char (void);
static void unget_char ( int c);


static int
get_char (void)
{
  int res = getc (input);
  ;

  return res;
}

static void
unget_char ( int c)
{
  ;

  ungetc (c, input);
}

static int
read_signed_integer (void)
{
  int c = get_char ();
  int sign = 1;
  int n = 0;

  ;
  if (c == '-')
    {
      c = get_char ();
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char ();
    }

  unget_char ( c);

  return sign * n;
}


/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number.  Skips all   |
| blanks and tabs, returns 0 for EOF.                            |
`---------------------------------------------------------------*/

int
yylex (void)
{
  static int init = 1;
  int c;

  if (init)
    {
      init = 0;

    }



  /* Skip white space.  */
  while ((c = get_char ()) == ' ' || c == '\t')
    {

    }

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char ( c);
      (yylval).ival = read_signed_integer ();
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}


static int
power (int base, int exponent)
{
  int res = 1;
  if (exponent < 0)
    exit (3);
  for (/* Niente */; exponent; --exponent)
    res *= base;
  return res;
}


int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* This used to be alarm (10), but that isn't enough time for
     a July 1995 vintage DEC Alphastation 200 4/100 system,
     according to Nelson H. F. Beebe.  100 seconds is enough.  */
  alarm (100);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  fclose (input);
  if (global_result != result)
    abort ();
  if (global_count != count)
    abort ();
  return status;
}
_ATEOF






if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/calc.at:568: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:568"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:568"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:568: bison --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:568"
( $at_check_trace; bison --xml=xml-tests/test.xml -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:568"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:568: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:568"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:568"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/calc.at:568: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:568"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:568"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/calc.at:568: bison -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:568"
( $at_check_trace; bison -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:568"
$at_failed && at_fn_log_failure
$at_traceon; }

   { set +x
$as_echo "$at_srcdir/calc.at:568: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:568"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:568"
$at_failed && at_fn_log_failure
$at_traceon; }



# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:568:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:568"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:568"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:568:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:568"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:568"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:568: cat stderr"
at_fn_check_prepare_trace "calc.at:568"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:568"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:568:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:568"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:568"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:568: cat stderr"
at_fn_check_prepare_trace "calc.at:568"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:568"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:568:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:568"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:568"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:568: cat stderr"
at_fn_check_prepare_trace "calc.at:568"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:568"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:568:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:568"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:568"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:568: cat stderr"
at_fn_check_prepare_trace "calc.at:568"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:568"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:568:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:568"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:568"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:568: cat stderr"
at_fn_check_prepare_trace "calc.at:568"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:568"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:568:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:568"
( $at_check_trace;  $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:568"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:568: cat stderr"
at_fn_check_prepare_trace "calc.at:568"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:568"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:568:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:568"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:568"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:568: cat stderr"
at_fn_check_prepare_trace "calc.at:568"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:568"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:568:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:568"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:568"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:568: cat stderr"
at_fn_check_prepare_trace "calc.at:568"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:568"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:568:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:568"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:568"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:568: cat stderr"
at_fn_check_prepare_trace "calc.at:568"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:568"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check that yyerrok works properly: second error is not reported,
# third and fourth are.  Parse status is succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:568:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:568"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:568"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:568: cat stderr"
at_fn_check_prepare_trace "calc.at:568"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:568"
$at_failed && at_fn_log_failure
$at_traceon; }



























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_119
#AT_START_120
# 120. calc.at:570: Calculator %defines
at_setup_line='calc.at:570'
at_fn_banner 10
at_desc="Calculator %defines"
at_desc_line="120: $at_desc                            "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "120. calc.at:570: testing ..."
  $at_traceon









# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.














cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%defines

%code requires {
/* Exercise pre-prologue dependency to %union.  */
typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};

%code provides {
#include <stdio.h>
/* The input.  */
extern FILE *input;
}

%code {
#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#else
# undef alarm
# define alarm(seconds) /* empty */
#endif
#define USE(Var)

FILE *input;
static semantic_value global_result = 0;
static int global_count = 0;
static int power (int base, int exponent);
/* yyerror receives the location if:
   - %location & %pure & %glr
   - %location & %pure & %yacc & %parse-param. */
static void yyerror (

                     const char *s
                     );
int yylex (void);
}



/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type  <ival> exp

%nonassoc '=' /* comparison	       */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line         {  }
;

line:
  '\n'
| exp '\n'           { USE ($1); }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static void
yyerror (

         const char *s)
{


  fprintf (stderr, "%s\n", s);
}



static int
power (int base, int exponent)
{
  int res = 1;
  if (exponent < 0)
    exit (3);
  for (/* Niente */; exponent; --exponent)
    res *= base;
  return res;
}


int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* This used to be alarm (10), but that isn't enough time for
     a July 1995 vintage DEC Alphastation 200 4/100 system,
     according to Nelson H. F. Beebe.  100 seconds is enough.  */
  alarm (100);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  fclose (input);
  if (global_result != result)
    abort ();
  if (global_count != count)
    abort ();
  return status;
}
_ATEOF


cat >calc-lex.c <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.h"

#include <ctype.h>

int yylex (void);
static int get_char (void);
static void unget_char ( int c);


static int
get_char (void)
{
  int res = getc (input);
  ;

  return res;
}

static void
unget_char ( int c)
{
  ;

  ungetc (c, input);
}

static int
read_signed_integer (void)
{
  int c = get_char ();
  int sign = 1;
  int n = 0;

  ;
  if (c == '-')
    {
      c = get_char ();
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char ();
    }

  unget_char ( c);

  return sign * n;
}


/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number.  Skips all   |
| blanks and tabs, returns 0 for EOF.                            |
`---------------------------------------------------------------*/

int
yylex (void)
{
  static int init = 1;
  int c;

  if (init)
    {
      init = 0;

    }



  /* Skip white space.  */
  while ((c = get_char ()) == ' ' || c == '\t')
    {

    }

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char ( c);
      (yylval).ival = read_signed_integer ();
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}
_ATEOF





if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/calc.at:570: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:570"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:570"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:570: bison --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:570"
( $at_check_trace; bison --xml=xml-tests/test.xml -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:570"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:570: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:570"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:570"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/calc.at:570: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:570"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:570"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/calc.at:570: bison -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:570"
( $at_check_trace; bison -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:570"
$at_failed && at_fn_log_failure
$at_traceon; }

   { set +x
$as_echo "$at_srcdir/calc.at:570: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c $LIBS" "calc.at:570"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:570"
$at_failed && at_fn_log_failure
$at_traceon; }



# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:570:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:570"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:570"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:570:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:570"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:570"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:570: cat stderr"
at_fn_check_prepare_trace "calc.at:570"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:570"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:570:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:570"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:570"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:570: cat stderr"
at_fn_check_prepare_trace "calc.at:570"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:570"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:570:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:570"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:570"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:570: cat stderr"
at_fn_check_prepare_trace "calc.at:570"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:570"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:570:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:570"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:570"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:570: cat stderr"
at_fn_check_prepare_trace "calc.at:570"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:570"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:570:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:570"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:570"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:570: cat stderr"
at_fn_check_prepare_trace "calc.at:570"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:570"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:570:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:570"
( $at_check_trace;  $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:570"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:570: cat stderr"
at_fn_check_prepare_trace "calc.at:570"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:570"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:570:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:570"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:570"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:570: cat stderr"
at_fn_check_prepare_trace "calc.at:570"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:570"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:570:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:570"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:570"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:570: cat stderr"
at_fn_check_prepare_trace "calc.at:570"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:570"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:570:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:570"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:570"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:570: cat stderr"
at_fn_check_prepare_trace "calc.at:570"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:570"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check that yyerrok works properly: second error is not reported,
# third and fourth are.  Parse status is succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:570:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:570"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:570"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:570: cat stderr"
at_fn_check_prepare_trace "calc.at:570"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:570"
$at_failed && at_fn_log_failure
$at_traceon; }



























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_120
#AT_START_121
# 121. calc.at:571: Calculator %locations
at_setup_line='calc.at:571'
at_fn_banner 10
at_desc="Calculator %locations"
at_desc_line="121: $at_desc                          "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "121. calc.at:571: testing ..."
  $at_traceon









# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.














cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%locations

%code requires {
/* Exercise pre-prologue dependency to %union.  */
typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};

%code provides {
#include <stdio.h>
/* The input.  */
extern FILE *input;
}

%code {
#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#else
# undef alarm
# define alarm(seconds) /* empty */
#endif
#define USE(Var)

FILE *input;
static semantic_value global_result = 0;
static int global_count = 0;
static int power (int base, int exponent);
/* yyerror receives the location if:
   - %location & %pure & %glr
   - %location & %pure & %yacc & %parse-param. */
static void yyerror (

                     const char *s
                     );
int yylex (void);
}



/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type  <ival> exp

%nonassoc '=' /* comparison	       */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line         {  }
;

line:
  '\n'
| exp '\n'           { USE ($1); }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static void
yyerror (

         const char *s)
{


  fprintf (stderr, "%d.%d",
           (yylloc).first_line, (yylloc).first_column);
  if ((yylloc).first_line != (yylloc).last_line)
    fprintf (stderr, "-%d.%d",
	     (yylloc).last_line,  (yylloc).last_column - 1);
  else if ((yylloc).first_column != (yylloc).last_column - 1)
    fprintf (stderr, "-%d",
	     (yylloc).last_column - 1);
  fprintf (stderr, ": ");
  fprintf (stderr, "%s\n", s);
}

#include <ctype.h>

int yylex (void);
static int get_char (void);
static void unget_char ( int c);


static YYLTYPE last_yylloc;

static int
get_char (void)
{
  int res = getc (input);
  ;

  last_yylloc = (yylloc);
  if (res == '\n')
    {
      (yylloc).last_line++;
      (yylloc).last_column = 1;
    }
  else
    (yylloc).last_column++;

  return res;
}

static void
unget_char ( int c)
{
  ;

  /* Wrong when C == `\n'. */
  (yylloc) = last_yylloc;

  ungetc (c, input);
}

static int
read_signed_integer (void)
{
  int c = get_char ();
  int sign = 1;
  int n = 0;

  ;
  if (c == '-')
    {
      c = get_char ();
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char ();
    }

  unget_char ( c);

  return sign * n;
}


/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number.  Skips all   |
| blanks and tabs, returns 0 for EOF.                            |
`---------------------------------------------------------------*/

int
yylex (void)
{
  static int init = 1;
  int c;

  if (init)
    {
      init = 0;

      (yylloc).last_column = 1;
      (yylloc).last_line = 1;

    }


 (yylloc).first_column = (yylloc).last_column;
  (yylloc).first_line   = (yylloc).last_line;


  /* Skip white space.  */
  while ((c = get_char ()) == ' ' || c == '\t')
    {
     (yylloc).first_column = (yylloc).last_column;
      (yylloc).first_line   = (yylloc).last_line;

    }

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char ( c);
      (yylval).ival = read_signed_integer ();
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}


static int
power (int base, int exponent)
{
  int res = 1;
  if (exponent < 0)
    exit (3);
  for (/* Niente */; exponent; --exponent)
    res *= base;
  return res;
}


int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* This used to be alarm (10), but that isn't enough time for
     a July 1995 vintage DEC Alphastation 200 4/100 system,
     according to Nelson H. F. Beebe.  100 seconds is enough.  */
  alarm (100);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  fclose (input);
  if (global_result != result)
    abort ();
  if (global_count != count)
    abort ();
  return status;
}
_ATEOF






if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/calc.at:571: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:571"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:571"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:571: bison --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:571"
( $at_check_trace; bison --xml=xml-tests/test.xml -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:571"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:571: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:571"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:571"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/calc.at:571: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:571"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:571"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/calc.at:571: bison -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:571"
( $at_check_trace; bison -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:571"
$at_failed && at_fn_log_failure
$at_traceon; }

   { set +x
$as_echo "$at_srcdir/calc.at:571: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:571"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:571"
$at_failed && at_fn_log_failure
$at_traceon; }



# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:571:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:571"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:571"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:571:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:571"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:571"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:571: cat stderr"
at_fn_check_prepare_trace "calc.at:571"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:571"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:571:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:571"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:571"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:571: cat stderr"
at_fn_check_prepare_trace "calc.at:571"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:571"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:571:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:571"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:571"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:571: cat stderr"
at_fn_check_prepare_trace "calc.at:571"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:571"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:571:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:571"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:571"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:571: cat stderr"
at_fn_check_prepare_trace "calc.at:571"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:571"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:571:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:571"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:571"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:571: cat stderr"
at_fn_check_prepare_trace "calc.at:571"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:571"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:571:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:571"
( $at_check_trace;  $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:571"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:571: cat stderr"
at_fn_check_prepare_trace "calc.at:571"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:571"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:571:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:571"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:571"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:571: cat stderr"
at_fn_check_prepare_trace "calc.at:571"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:571"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:571:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:571"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:571"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:571: cat stderr"
at_fn_check_prepare_trace "calc.at:571"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:571"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:571:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:571"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:571"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:571: cat stderr"
at_fn_check_prepare_trace "calc.at:571"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:571"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check that yyerrok works properly: second error is not reported,
# third and fourth are.  Parse status is succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:571:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:571"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:571"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:571: cat stderr"
at_fn_check_prepare_trace "calc.at:571"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:571"
$at_failed && at_fn_log_failure
$at_traceon; }



























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_121
#AT_START_122
# 122. calc.at:572: Calculator %name-prefix="calc"
at_setup_line='calc.at:572'
at_fn_banner 10
at_desc="Calculator %name-prefix=\"calc\""
at_desc_line="122: $at_desc                 "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "122. calc.at:572: testing ..."
  $at_traceon









# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.














cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%name-prefix="calc"

%code requires {
/* Exercise pre-prologue dependency to %union.  */
typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};

%code provides {
#include <stdio.h>
/* The input.  */
extern FILE *input;
}

%code {
#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#else
# undef alarm
# define alarm(seconds) /* empty */
#endif
#define USE(Var)

FILE *input;
static semantic_value global_result = 0;
static int global_count = 0;
static int power (int base, int exponent);
/* yyerror receives the location if:
   - %location & %pure & %glr
   - %location & %pure & %yacc & %parse-param. */
static void yyerror (

                     const char *s
                     );
int yylex (void);
}



/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type  <ival> exp

%nonassoc '=' /* comparison	       */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line         {  }
;

line:
  '\n'
| exp '\n'           { USE ($1); }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static void
yyerror (

         const char *s)
{


  fprintf (stderr, "%s\n", s);
}

#include <ctype.h>

int yylex (void);
static int get_char (void);
static void unget_char ( int c);


static int
get_char (void)
{
  int res = getc (input);
  ;

  return res;
}

static void
unget_char ( int c)
{
  ;

  ungetc (c, input);
}

static int
read_signed_integer (void)
{
  int c = get_char ();
  int sign = 1;
  int n = 0;

  ;
  if (c == '-')
    {
      c = get_char ();
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char ();
    }

  unget_char ( c);

  return sign * n;
}


/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number.  Skips all   |
| blanks and tabs, returns 0 for EOF.                            |
`---------------------------------------------------------------*/

int
yylex (void)
{
  static int init = 1;
  int c;

  if (init)
    {
      init = 0;

    }



  /* Skip white space.  */
  while ((c = get_char ()) == ' ' || c == '\t')
    {

    }

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char ( c);
      (yylval).ival = read_signed_integer ();
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}


static int
power (int base, int exponent)
{
  int res = 1;
  if (exponent < 0)
    exit (3);
  for (/* Niente */; exponent; --exponent)
    res *= base;
  return res;
}


int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* This used to be alarm (10), but that isn't enough time for
     a July 1995 vintage DEC Alphastation 200 4/100 system,
     according to Nelson H. F. Beebe.  100 seconds is enough.  */
  alarm (100);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  fclose (input);
  if (global_result != result)
    abort ();
  if (global_count != count)
    abort ();
  return status;
}
_ATEOF






if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/calc.at:572: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:572"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:572"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:572: bison --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:572"
( $at_check_trace; bison --xml=xml-tests/test.xml -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:572"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:572: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:572"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:572"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/calc.at:572: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:572"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:572"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/calc.at:572: bison -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:572"
( $at_check_trace; bison -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:572"
$at_failed && at_fn_log_failure
$at_traceon; }

   { set +x
$as_echo "$at_srcdir/calc.at:572: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:572"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:572"
$at_failed && at_fn_log_failure
$at_traceon; }



# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:572:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:572"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:572"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:572:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:572"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:572"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:572: cat stderr"
at_fn_check_prepare_trace "calc.at:572"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:572"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:572:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:572"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:572"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:572: cat stderr"
at_fn_check_prepare_trace "calc.at:572"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:572"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:572:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:572"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:572"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:572: cat stderr"
at_fn_check_prepare_trace "calc.at:572"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:572"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:572:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:572"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:572"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:572: cat stderr"
at_fn_check_prepare_trace "calc.at:572"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:572"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:572:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:572"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:572"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:572: cat stderr"
at_fn_check_prepare_trace "calc.at:572"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:572"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:572:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:572"
( $at_check_trace;  $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:572"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:572: cat stderr"
at_fn_check_prepare_trace "calc.at:572"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:572"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:572:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:572"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:572"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:572: cat stderr"
at_fn_check_prepare_trace "calc.at:572"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:572"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:572:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:572"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:572"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:572: cat stderr"
at_fn_check_prepare_trace "calc.at:572"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:572"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:572:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:572"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:572"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:572: cat stderr"
at_fn_check_prepare_trace "calc.at:572"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:572"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check that yyerrok works properly: second error is not reported,
# third and fourth are.  Parse status is succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:572:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:572"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:572"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:572: cat stderr"
at_fn_check_prepare_trace "calc.at:572"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:572"
$at_failed && at_fn_log_failure
$at_traceon; }



























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_122
#AT_START_123
# 123. calc.at:573: Calculator %verbose
at_setup_line='calc.at:573'
at_fn_banner 10
at_desc="Calculator %verbose"
at_desc_line="123: $at_desc                            "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "123. calc.at:573: testing ..."
  $at_traceon









# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.














cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%verbose

%code requires {
/* Exercise pre-prologue dependency to %union.  */
typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};

%code provides {
#include <stdio.h>
/* The input.  */
extern FILE *input;
}

%code {
#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#else
# undef alarm
# define alarm(seconds) /* empty */
#endif
#define USE(Var)

FILE *input;
static semantic_value global_result = 0;
static int global_count = 0;
static int power (int base, int exponent);
/* yyerror receives the location if:
   - %location & %pure & %glr
   - %location & %pure & %yacc & %parse-param. */
static void yyerror (

                     const char *s
                     );
int yylex (void);
}



/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type  <ival> exp

%nonassoc '=' /* comparison	       */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line         {  }
;

line:
  '\n'
| exp '\n'           { USE ($1); }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static void
yyerror (

         const char *s)
{


  fprintf (stderr, "%s\n", s);
}

#include <ctype.h>

int yylex (void);
static int get_char (void);
static void unget_char ( int c);


static int
get_char (void)
{
  int res = getc (input);
  ;

  return res;
}

static void
unget_char ( int c)
{
  ;

  ungetc (c, input);
}

static int
read_signed_integer (void)
{
  int c = get_char ();
  int sign = 1;
  int n = 0;

  ;
  if (c == '-')
    {
      c = get_char ();
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char ();
    }

  unget_char ( c);

  return sign * n;
}


/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number.  Skips all   |
| blanks and tabs, returns 0 for EOF.                            |
`---------------------------------------------------------------*/

int
yylex (void)
{
  static int init = 1;
  int c;

  if (init)
    {
      init = 0;

    }



  /* Skip white space.  */
  while ((c = get_char ()) == ' ' || c == '\t')
    {

    }

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char ( c);
      (yylval).ival = read_signed_integer ();
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}


static int
power (int base, int exponent)
{
  int res = 1;
  if (exponent < 0)
    exit (3);
  for (/* Niente */; exponent; --exponent)
    res *= base;
  return res;
}


int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* This used to be alarm (10), but that isn't enough time for
     a July 1995 vintage DEC Alphastation 200 4/100 system,
     according to Nelson H. F. Beebe.  100 seconds is enough.  */
  alarm (100);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  fclose (input);
  if (global_result != result)
    abort ();
  if (global_count != count)
    abort ();
  return status;
}
_ATEOF






if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/calc.at:573: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:573"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:573"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:573: bison --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:573"
( $at_check_trace; bison --xml=xml-tests/test.xml -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:573"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:573: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:573"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:573"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/calc.at:573: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:573"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:573"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/calc.at:573: bison -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:573"
( $at_check_trace; bison -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:573"
$at_failed && at_fn_log_failure
$at_traceon; }

   { set +x
$as_echo "$at_srcdir/calc.at:573: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:573"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:573"
$at_failed && at_fn_log_failure
$at_traceon; }



# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:573:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:573"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:573"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:573:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:573"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:573"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:573: cat stderr"
at_fn_check_prepare_trace "calc.at:573"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:573"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:573:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:573"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:573"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:573: cat stderr"
at_fn_check_prepare_trace "calc.at:573"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:573"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:573:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:573"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:573"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:573: cat stderr"
at_fn_check_prepare_trace "calc.at:573"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:573"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:573:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:573"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:573"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:573: cat stderr"
at_fn_check_prepare_trace "calc.at:573"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:573"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:573:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:573"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:573"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:573: cat stderr"
at_fn_check_prepare_trace "calc.at:573"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:573"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:573:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:573"
( $at_check_trace;  $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:573"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:573: cat stderr"
at_fn_check_prepare_trace "calc.at:573"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:573"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:573:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:573"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:573"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:573: cat stderr"
at_fn_check_prepare_trace "calc.at:573"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:573"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:573:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:573"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:573"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:573: cat stderr"
at_fn_check_prepare_trace "calc.at:573"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:573"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:573:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:573"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:573"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:573: cat stderr"
at_fn_check_prepare_trace "calc.at:573"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:573"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check that yyerrok works properly: second error is not reported,
# third and fourth are.  Parse status is succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:573:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:573"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:573"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:573: cat stderr"
at_fn_check_prepare_trace "calc.at:573"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:573"
$at_failed && at_fn_log_failure
$at_traceon; }



























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_123
#AT_START_124
# 124. calc.at:574: Calculator %yacc
at_setup_line='calc.at:574'
at_fn_banner 10
at_desc="Calculator %yacc"
at_desc_line="124: $at_desc                               "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "124. calc.at:574: testing ..."
  $at_traceon









# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.














cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%yacc

%code requires {
/* Exercise pre-prologue dependency to %union.  */
typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};

%code provides {
#include <stdio.h>
/* The input.  */
extern FILE *input;
}

%code {
#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#else
# undef alarm
# define alarm(seconds) /* empty */
#endif
#define USE(Var)

FILE *input;
static semantic_value global_result = 0;
static int global_count = 0;
static int power (int base, int exponent);
/* yyerror receives the location if:
   - %location & %pure & %glr
   - %location & %pure & %yacc & %parse-param. */
static void yyerror (

                     const char *s
                     );
int yylex (void);
}



/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type  <ival> exp

%nonassoc '=' /* comparison	       */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line         {  }
;

line:
  '\n'
| exp '\n'           { USE ($1); }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static void
yyerror (

         const char *s)
{


  fprintf (stderr, "%s\n", s);
}

#include <ctype.h>

int yylex (void);
static int get_char (void);
static void unget_char ( int c);


static int
get_char (void)
{
  int res = getc (input);
  ;

  return res;
}

static void
unget_char ( int c)
{
  ;

  ungetc (c, input);
}

static int
read_signed_integer (void)
{
  int c = get_char ();
  int sign = 1;
  int n = 0;

  ;
  if (c == '-')
    {
      c = get_char ();
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char ();
    }

  unget_char ( c);

  return sign * n;
}


/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number.  Skips all   |
| blanks and tabs, returns 0 for EOF.                            |
`---------------------------------------------------------------*/

int
yylex (void)
{
  static int init = 1;
  int c;

  if (init)
    {
      init = 0;

    }



  /* Skip white space.  */
  while ((c = get_char ()) == ' ' || c == '\t')
    {

    }

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char ( c);
      (yylval).ival = read_signed_integer ();
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}


static int
power (int base, int exponent)
{
  int res = 1;
  if (exponent < 0)
    exit (3);
  for (/* Niente */; exponent; --exponent)
    res *= base;
  return res;
}


int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* This used to be alarm (10), but that isn't enough time for
     a July 1995 vintage DEC Alphastation 200 4/100 system,
     according to Nelson H. F. Beebe.  100 seconds is enough.  */
  alarm (100);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  fclose (input);
  if (global_result != result)
    abort ();
  if (global_count != count)
    abort ();
  return status;
}
_ATEOF






if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/calc.at:574: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:574"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:574"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:574: bison --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:574"
( $at_check_trace; bison --xml=xml-tests/test.xml -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:574"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:574: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:574"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:574"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/calc.at:574: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:574"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:574"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/calc.at:574: bison -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:574"
( $at_check_trace; bison -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:574"
$at_failed && at_fn_log_failure
$at_traceon; }

   { set +x
$as_echo "$at_srcdir/calc.at:574: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:574"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:574"
$at_failed && at_fn_log_failure
$at_traceon; }



# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:574:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:574"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:574"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:574:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:574"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:574"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:574: cat stderr"
at_fn_check_prepare_trace "calc.at:574"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:574"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:574:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:574"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:574"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:574: cat stderr"
at_fn_check_prepare_trace "calc.at:574"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:574"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:574:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:574"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:574"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:574: cat stderr"
at_fn_check_prepare_trace "calc.at:574"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:574"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:574:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:574"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:574"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:574: cat stderr"
at_fn_check_prepare_trace "calc.at:574"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:574"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:574:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:574"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:574"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:574: cat stderr"
at_fn_check_prepare_trace "calc.at:574"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:574"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:574:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:574"
( $at_check_trace;  $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:574"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:574: cat stderr"
at_fn_check_prepare_trace "calc.at:574"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:574"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:574:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:574"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:574"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:574: cat stderr"
at_fn_check_prepare_trace "calc.at:574"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:574"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:574:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:574"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:574"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:574: cat stderr"
at_fn_check_prepare_trace "calc.at:574"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:574"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:574:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:574"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:574"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:574: cat stderr"
at_fn_check_prepare_trace "calc.at:574"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:574"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check that yyerrok works properly: second error is not reported,
# third and fourth are.  Parse status is succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:574:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:574"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:574"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:574: cat stderr"
at_fn_check_prepare_trace "calc.at:574"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:574"
$at_failed && at_fn_log_failure
$at_traceon; }



























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_124
#AT_START_125
# 125. calc.at:575: Calculator %error-verbose
at_setup_line='calc.at:575'
at_fn_banner 10
at_desc="Calculator %error-verbose"
at_desc_line="125: $at_desc                      "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "125. calc.at:575: testing ..."
  $at_traceon









# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.














cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%error-verbose

%code requires {
/* Exercise pre-prologue dependency to %union.  */
typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};

%code provides {
#include <stdio.h>
/* The input.  */
extern FILE *input;
}

%code {
#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#else
# undef alarm
# define alarm(seconds) /* empty */
#endif
#define USE(Var)

FILE *input;
static semantic_value global_result = 0;
static int global_count = 0;
static int power (int base, int exponent);
/* yyerror receives the location if:
   - %location & %pure & %glr
   - %location & %pure & %yacc & %parse-param. */
static void yyerror (

                     const char *s
                     );
int yylex (void);
}



/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type  <ival> exp

%nonassoc '=' /* comparison	       */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line         {  }
;

line:
  '\n'
| exp '\n'           { USE ($1); }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static void
yyerror (

         const char *s)
{


  fprintf (stderr, "%s\n", s);
}

#include <ctype.h>

int yylex (void);
static int get_char (void);
static void unget_char ( int c);


static int
get_char (void)
{
  int res = getc (input);
  ;

  return res;
}

static void
unget_char ( int c)
{
  ;

  ungetc (c, input);
}

static int
read_signed_integer (void)
{
  int c = get_char ();
  int sign = 1;
  int n = 0;

  ;
  if (c == '-')
    {
      c = get_char ();
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char ();
    }

  unget_char ( c);

  return sign * n;
}


/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number.  Skips all   |
| blanks and tabs, returns 0 for EOF.                            |
`---------------------------------------------------------------*/

int
yylex (void)
{
  static int init = 1;
  int c;

  if (init)
    {
      init = 0;

    }



  /* Skip white space.  */
  while ((c = get_char ()) == ' ' || c == '\t')
    {

    }

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char ( c);
      (yylval).ival = read_signed_integer ();
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}


static int
power (int base, int exponent)
{
  int res = 1;
  if (exponent < 0)
    exit (3);
  for (/* Niente */; exponent; --exponent)
    res *= base;
  return res;
}


int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* This used to be alarm (10), but that isn't enough time for
     a July 1995 vintage DEC Alphastation 200 4/100 system,
     according to Nelson H. F. Beebe.  100 seconds is enough.  */
  alarm (100);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  fclose (input);
  if (global_result != result)
    abort ();
  if (global_count != count)
    abort ();
  return status;
}
_ATEOF






if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/calc.at:575: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:575"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:575"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:575: bison --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:575"
( $at_check_trace; bison --xml=xml-tests/test.xml -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:575"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:575: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:575"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:575"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/calc.at:575: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:575"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:575"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/calc.at:575: bison -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:575"
( $at_check_trace; bison -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:575"
$at_failed && at_fn_log_failure
$at_traceon; }

   { set +x
$as_echo "$at_srcdir/calc.at:575: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:575"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:575"
$at_failed && at_fn_log_failure
$at_traceon; }



# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:575:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:575"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:575"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:575:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:575"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:575"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:575: cat stderr"
at_fn_check_prepare_trace "calc.at:575"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:575"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:575:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:575"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:575"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:575: cat stderr"
at_fn_check_prepare_trace "calc.at:575"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:575"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:575:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:575"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:575"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:575: cat stderr"
at_fn_check_prepare_trace "calc.at:575"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:575"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:575:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:575"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:575"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:575: cat stderr"
at_fn_check_prepare_trace "calc.at:575"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:575"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:575:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:575"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:575"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:575: cat stderr"
at_fn_check_prepare_trace "calc.at:575"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:575"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:575:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:575"
( $at_check_trace;  $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:575"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:575: cat stderr"
at_fn_check_prepare_trace "calc.at:575"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:575"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:575:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:575"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:575"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:575: cat stderr"
at_fn_check_prepare_trace "calc.at:575"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:575"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:575:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:575"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:575"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:575: cat stderr"
at_fn_check_prepare_trace "calc.at:575"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:575"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:575:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:575"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:575"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:575: cat stderr"
at_fn_check_prepare_trace "calc.at:575"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:575"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check that yyerrok works properly: second error is not reported,
# third and fourth are.  Parse status is succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:575:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:575"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:575"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:575: cat stderr"
at_fn_check_prepare_trace "calc.at:575"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:575"
$at_failed && at_fn_log_failure
$at_traceon; }



























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_125
#AT_START_126
# 126. calc.at:577: Calculator %define api.pure %locations
at_setup_line='calc.at:577'
at_fn_banner 10
at_desc="Calculator %define api.pure %locations"
at_desc_line="126: $at_desc         "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "126. calc.at:577: testing ..."
  $at_traceon









# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.














cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%define api.pure %locations

%code requires {
/* Exercise pre-prologue dependency to %union.  */
typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};

%code provides {
#include <stdio.h>
/* The input.  */
extern FILE *input;
}

%code {
#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#else
# undef alarm
# define alarm(seconds) /* empty */
#endif
#define USE(Var)

FILE *input;
static semantic_value global_result = 0;
static int global_count = 0;
static int power (int base, int exponent);
/* yyerror receives the location if:
   - %location & %pure & %glr
   - %location & %pure & %yacc & %parse-param. */
static void yyerror (

                     const char *s
                     );
int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
}



/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type  <ival> exp

%nonassoc '=' /* comparison	       */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line         {  }
;

line:
  '\n'
| exp '\n'           { USE ($1); }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static void
yyerror (

         const char *s)
{


  fprintf (stderr, "%s\n", s);
}

#include <ctype.h>

int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp);
static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c);


static YYLTYPE last_yylloc;

static int
get_char (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int res = getc (input);
  (void) lvalp;(void) llocp;

  last_yylloc = (*llocp);
  if (res == '\n')
    {
      (*llocp).last_line++;
      (*llocp).last_column = 1;
    }
  else
    (*llocp).last_column++;

  return res;
}

static void
unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c)
{
  (void) lvalp;(void) llocp;

  /* Wrong when C == `\n'. */
  (*llocp) = last_yylloc;

  ungetc (c, input);
}

static int
read_signed_integer (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int c = get_char (lvalp, llocp);
  int sign = 1;
  int n = 0;

  (void) lvalp;(void) llocp;
  if (c == '-')
    {
      c = get_char (lvalp, llocp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp, llocp);
    }

  unget_char (lvalp, llocp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number.  Skips all   |
| blanks and tabs, returns 0 for EOF.                            |
`---------------------------------------------------------------*/

int
yylex (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  static int init = 1;
  int c;

  if (init)
    {
      init = 0;

      (*llocp).last_column = 1;
      (*llocp).last_line = 1;

    }


 (*llocp).first_column = (*llocp).last_column;
  (*llocp).first_line   = (*llocp).last_line;


  /* Skip white space.  */
  while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t')
    {
     (*llocp).first_column = (*llocp).last_column;
      (*llocp).first_line   = (*llocp).last_line;

    }

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp, llocp,  c);
      (*lvalp).ival = read_signed_integer (lvalp, llocp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}


static int
power (int base, int exponent)
{
  int res = 1;
  if (exponent < 0)
    exit (3);
  for (/* Niente */; exponent; --exponent)
    res *= base;
  return res;
}


int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* This used to be alarm (10), but that isn't enough time for
     a July 1995 vintage DEC Alphastation 200 4/100 system,
     according to Nelson H. F. Beebe.  100 seconds is enough.  */
  alarm (100);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  fclose (input);
  if (global_result != result)
    abort ();
  if (global_count != count)
    abort ();
  return status;
}
_ATEOF






if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/calc.at:577: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:577"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:577"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:577: bison --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:577"
( $at_check_trace; bison --xml=xml-tests/test.xml -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:577"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:577: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:577"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:577"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/calc.at:577: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:577"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:577"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/calc.at:577: bison -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:577"
( $at_check_trace; bison -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:577"
$at_failed && at_fn_log_failure
$at_traceon; }

   { set +x
$as_echo "$at_srcdir/calc.at:577: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:577"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:577"
$at_failed && at_fn_log_failure
$at_traceon; }



# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:577:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:577"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:577"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:577:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:577"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:577"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:577: cat stderr"
at_fn_check_prepare_trace "calc.at:577"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:577"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:577:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:577"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:577"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:577: cat stderr"
at_fn_check_prepare_trace "calc.at:577"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:577"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:577:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:577"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:577"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:577: cat stderr"
at_fn_check_prepare_trace "calc.at:577"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:577"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:577:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:577"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:577"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:577: cat stderr"
at_fn_check_prepare_trace "calc.at:577"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:577"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:577:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:577"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:577"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:577: cat stderr"
at_fn_check_prepare_trace "calc.at:577"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:577"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:577:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:577"
( $at_check_trace;  $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:577"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:577: cat stderr"
at_fn_check_prepare_trace "calc.at:577"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:577"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:577:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:577"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:577"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:577: cat stderr"
at_fn_check_prepare_trace "calc.at:577"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:577"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:577:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:577"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:577"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:577: cat stderr"
at_fn_check_prepare_trace "calc.at:577"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:577"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:577:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:577"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:577"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:577: cat stderr"
at_fn_check_prepare_trace "calc.at:577"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:577"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check that yyerrok works properly: second error is not reported,
# third and fourth are.  Parse status is succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:577:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:577"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:577"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:577: cat stderr"
at_fn_check_prepare_trace "calc.at:577"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:577"
$at_failed && at_fn_log_failure
$at_traceon; }



























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_126
#AT_START_127
# 127. calc.at:578: Calculator %define api.push_pull "both" %define api.pure %locations
at_setup_line='calc.at:578'
at_fn_banner 10
at_desc="Calculator %define api.push_pull \"both\" %define api.pure %locations"
at_desc_line="127: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "127. calc.at:578: testing ..."
  $at_traceon









# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.














cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%define api.push_pull "both" %define api.pure %locations

%code requires {
/* Exercise pre-prologue dependency to %union.  */
typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};

%code provides {
#include <stdio.h>
/* The input.  */
extern FILE *input;
}

%code {
#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#else
# undef alarm
# define alarm(seconds) /* empty */
#endif
#define USE(Var)

FILE *input;
static semantic_value global_result = 0;
static int global_count = 0;
static int power (int base, int exponent);
/* yyerror receives the location if:
   - %location & %pure & %glr
   - %location & %pure & %yacc & %parse-param. */
static void yyerror (

                     const char *s
                     );
int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
}



/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type  <ival> exp

%nonassoc '=' /* comparison	       */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line         {  }
;

line:
  '\n'
| exp '\n'           { USE ($1); }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static void
yyerror (

         const char *s)
{


  fprintf (stderr, "%s\n", s);
}

#include <ctype.h>

int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp);
static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c);


static YYLTYPE last_yylloc;

static int
get_char (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int res = getc (input);
  (void) lvalp;(void) llocp;

  last_yylloc = (*llocp);
  if (res == '\n')
    {
      (*llocp).last_line++;
      (*llocp).last_column = 1;
    }
  else
    (*llocp).last_column++;

  return res;
}

static void
unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c)
{
  (void) lvalp;(void) llocp;

  /* Wrong when C == `\n'. */
  (*llocp) = last_yylloc;

  ungetc (c, input);
}

static int
read_signed_integer (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int c = get_char (lvalp, llocp);
  int sign = 1;
  int n = 0;

  (void) lvalp;(void) llocp;
  if (c == '-')
    {
      c = get_char (lvalp, llocp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp, llocp);
    }

  unget_char (lvalp, llocp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number.  Skips all   |
| blanks and tabs, returns 0 for EOF.                            |
`---------------------------------------------------------------*/

int
yylex (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  static int init = 1;
  int c;

  if (init)
    {
      init = 0;

      (*llocp).last_column = 1;
      (*llocp).last_line = 1;

    }


 (*llocp).first_column = (*llocp).last_column;
  (*llocp).first_line   = (*llocp).last_line;


  /* Skip white space.  */
  while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t')
    {
     (*llocp).first_column = (*llocp).last_column;
      (*llocp).first_line   = (*llocp).last_line;

    }

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp, llocp,  c);
      (*lvalp).ival = read_signed_integer (lvalp, llocp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}


static int
power (int base, int exponent)
{
  int res = 1;
  if (exponent < 0)
    exit (3);
  for (/* Niente */; exponent; --exponent)
    res *= base;
  return res;
}


int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* This used to be alarm (10), but that isn't enough time for
     a July 1995 vintage DEC Alphastation 200 4/100 system,
     according to Nelson H. F. Beebe.  100 seconds is enough.  */
  alarm (100);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  fclose (input);
  if (global_result != result)
    abort ();
  if (global_count != count)
    abort ();
  return status;
}
_ATEOF






if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/calc.at:578: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:578"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:578"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:578: bison --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:578"
( $at_check_trace; bison --xml=xml-tests/test.xml -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:578"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:578: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:578"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:578"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/calc.at:578: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:578"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:578"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/calc.at:578: bison -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:578"
( $at_check_trace; bison -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:578"
$at_failed && at_fn_log_failure
$at_traceon; }

   { set +x
$as_echo "$at_srcdir/calc.at:578: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:578"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:578"
$at_failed && at_fn_log_failure
$at_traceon; }



# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:578:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:578"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:578"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:578:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:578"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:578"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:578: cat stderr"
at_fn_check_prepare_trace "calc.at:578"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:578"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:578:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:578"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:578"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:578: cat stderr"
at_fn_check_prepare_trace "calc.at:578"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:578"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:578:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:578"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:578"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:578: cat stderr"
at_fn_check_prepare_trace "calc.at:578"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:578"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:578:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:578"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:578"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:578: cat stderr"
at_fn_check_prepare_trace "calc.at:578"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:578"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:578:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:578"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:578"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:578: cat stderr"
at_fn_check_prepare_trace "calc.at:578"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:578"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:578:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:578"
( $at_check_trace;  $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:578"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:578: cat stderr"
at_fn_check_prepare_trace "calc.at:578"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:578"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:578:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:578"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:578"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:578: cat stderr"
at_fn_check_prepare_trace "calc.at:578"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:578"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:578:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:578"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:578"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:578: cat stderr"
at_fn_check_prepare_trace "calc.at:578"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:578"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:578:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:578"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:578"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:578: cat stderr"
at_fn_check_prepare_trace "calc.at:578"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:578"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check that yyerrok works properly: second error is not reported,
# third and fourth are.  Parse status is succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:578:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:578"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:578"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:578: cat stderr"
at_fn_check_prepare_trace "calc.at:578"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:578"
$at_failed && at_fn_log_failure
$at_traceon; }



























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_127
#AT_START_128
# 128. calc.at:579: Calculator %error-verbose %locations
at_setup_line='calc.at:579'
at_fn_banner 10
at_desc="Calculator %error-verbose %locations"
at_desc_line="128: $at_desc           "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "128. calc.at:579: testing ..."
  $at_traceon









# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.














cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%error-verbose %locations

%code requires {
/* Exercise pre-prologue dependency to %union.  */
typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};

%code provides {
#include <stdio.h>
/* The input.  */
extern FILE *input;
}

%code {
#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#else
# undef alarm
# define alarm(seconds) /* empty */
#endif
#define USE(Var)

FILE *input;
static semantic_value global_result = 0;
static int global_count = 0;
static int power (int base, int exponent);
/* yyerror receives the location if:
   - %location & %pure & %glr
   - %location & %pure & %yacc & %parse-param. */
static void yyerror (

                     const char *s
                     );
int yylex (void);
}



/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type  <ival> exp

%nonassoc '=' /* comparison	       */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line         {  }
;

line:
  '\n'
| exp '\n'           { USE ($1); }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static void
yyerror (

         const char *s)
{


  fprintf (stderr, "%d.%d",
           (yylloc).first_line, (yylloc).first_column);
  if ((yylloc).first_line != (yylloc).last_line)
    fprintf (stderr, "-%d.%d",
	     (yylloc).last_line,  (yylloc).last_column - 1);
  else if ((yylloc).first_column != (yylloc).last_column - 1)
    fprintf (stderr, "-%d",
	     (yylloc).last_column - 1);
  fprintf (stderr, ": ");
  fprintf (stderr, "%s\n", s);
}

#include <ctype.h>

int yylex (void);
static int get_char (void);
static void unget_char ( int c);


static YYLTYPE last_yylloc;

static int
get_char (void)
{
  int res = getc (input);
  ;

  last_yylloc = (yylloc);
  if (res == '\n')
    {
      (yylloc).last_line++;
      (yylloc).last_column = 1;
    }
  else
    (yylloc).last_column++;

  return res;
}

static void
unget_char ( int c)
{
  ;

  /* Wrong when C == `\n'. */
  (yylloc) = last_yylloc;

  ungetc (c, input);
}

static int
read_signed_integer (void)
{
  int c = get_char ();
  int sign = 1;
  int n = 0;

  ;
  if (c == '-')
    {
      c = get_char ();
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char ();
    }

  unget_char ( c);

  return sign * n;
}


/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number.  Skips all   |
| blanks and tabs, returns 0 for EOF.                            |
`---------------------------------------------------------------*/

int
yylex (void)
{
  static int init = 1;
  int c;

  if (init)
    {
      init = 0;

      (yylloc).last_column = 1;
      (yylloc).last_line = 1;

    }


 (yylloc).first_column = (yylloc).last_column;
  (yylloc).first_line   = (yylloc).last_line;


  /* Skip white space.  */
  while ((c = get_char ()) == ' ' || c == '\t')
    {
     (yylloc).first_column = (yylloc).last_column;
      (yylloc).first_line   = (yylloc).last_line;

    }

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char ( c);
      (yylval).ival = read_signed_integer ();
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}


static int
power (int base, int exponent)
{
  int res = 1;
  if (exponent < 0)
    exit (3);
  for (/* Niente */; exponent; --exponent)
    res *= base;
  return res;
}


int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* This used to be alarm (10), but that isn't enough time for
     a July 1995 vintage DEC Alphastation 200 4/100 system,
     according to Nelson H. F. Beebe.  100 seconds is enough.  */
  alarm (100);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  fclose (input);
  if (global_result != result)
    abort ();
  if (global_count != count)
    abort ();
  return status;
}
_ATEOF






if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/calc.at:579: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:579"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:579"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:579: bison --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:579"
( $at_check_trace; bison --xml=xml-tests/test.xml -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:579"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:579: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:579"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:579"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/calc.at:579: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:579"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:579"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/calc.at:579: bison -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:579"
( $at_check_trace; bison -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:579"
$at_failed && at_fn_log_failure
$at_traceon; }

   { set +x
$as_echo "$at_srcdir/calc.at:579: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:579"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:579"
$at_failed && at_fn_log_failure
$at_traceon; }



# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:579:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:579"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:579"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:579:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:579"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:579"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:579: cat stderr"
at_fn_check_prepare_trace "calc.at:579"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:579"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:579:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:579"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:579"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:579: cat stderr"
at_fn_check_prepare_trace "calc.at:579"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:579"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:579:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:579"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:579"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:579: cat stderr"
at_fn_check_prepare_trace "calc.at:579"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:579"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:579:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:579"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:579"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:579: cat stderr"
at_fn_check_prepare_trace "calc.at:579"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:579"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:579:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:579"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:579"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:579: cat stderr"
at_fn_check_prepare_trace "calc.at:579"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:579"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:579:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:579"
( $at_check_trace;  $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:579"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:579: cat stderr"
at_fn_check_prepare_trace "calc.at:579"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:579"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:579:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:579"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:579"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:579: cat stderr"
at_fn_check_prepare_trace "calc.at:579"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:579"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:579:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:579"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:579"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:579: cat stderr"
at_fn_check_prepare_trace "calc.at:579"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:579"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:579:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:579"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:579"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:579: cat stderr"
at_fn_check_prepare_trace "calc.at:579"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:579"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check that yyerrok works properly: second error is not reported,
# third and fourth are.  Parse status is succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:579:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:579"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:579"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:579: cat stderr"
at_fn_check_prepare_trace "calc.at:579"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:579"
$at_failed && at_fn_log_failure
$at_traceon; }



























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_128
#AT_START_129
# 129. calc.at:581: Calculator %error-verbose %locations %defines %name-prefix "calc" %verbose %yacc
at_setup_line='calc.at:581'
at_fn_banner 10
at_desc="Calculator %error-verbose %locations %defines %name-prefix \"calc\" %verbose %yacc"
at_desc_line="129: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "129. calc.at:581: testing ..."
  $at_traceon









# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.














cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%error-verbose %locations %defines %name-prefix "calc" %verbose %yacc

%code requires {
/* Exercise pre-prologue dependency to %union.  */
typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};

%code provides {
#include <stdio.h>
/* The input.  */
extern FILE *input;
}

%code {
#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#else
# undef alarm
# define alarm(seconds) /* empty */
#endif
#define USE(Var)

FILE *input;
static semantic_value global_result = 0;
static int global_count = 0;
static int power (int base, int exponent);
/* yyerror receives the location if:
   - %location & %pure & %glr
   - %location & %pure & %yacc & %parse-param. */
static void yyerror (

                     const char *s
                     );
int yylex (void);
}



/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type  <ival> exp

%nonassoc '=' /* comparison	       */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line         {  }
;

line:
  '\n'
| exp '\n'           { USE ($1); }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static void
yyerror (

         const char *s)
{


  fprintf (stderr, "%d.%d",
           (calclloc).first_line, (calclloc).first_column);
  if ((calclloc).first_line != (calclloc).last_line)
    fprintf (stderr, "-%d.%d",
	     (calclloc).last_line,  (calclloc).last_column - 1);
  else if ((calclloc).first_column != (calclloc).last_column - 1)
    fprintf (stderr, "-%d",
	     (calclloc).last_column - 1);
  fprintf (stderr, ": ");
  fprintf (stderr, "%s\n", s);
}



static int
power (int base, int exponent)
{
  int res = 1;
  if (exponent < 0)
    exit (3);
  for (/* Niente */; exponent; --exponent)
    res *= base;
  return res;
}


int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* This used to be alarm (10), but that isn't enough time for
     a July 1995 vintage DEC Alphastation 200 4/100 system,
     according to Nelson H. F. Beebe.  100 seconds is enough.  */
  alarm (100);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  fclose (input);
  if (global_result != result)
    abort ();
  if (global_count != count)
    abort ();
  return status;
}
_ATEOF


cat >calc-lex.c <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.h"

#include <ctype.h>

int calclex (void);
static int get_char (void);
static void unget_char ( int c);


static YYLTYPE last_yylloc;

static int
get_char (void)
{
  int res = getc (input);
  ;

  last_yylloc = (calclloc);
  if (res == '\n')
    {
      (calclloc).last_line++;
      (calclloc).last_column = 1;
    }
  else
    (calclloc).last_column++;

  return res;
}

static void
unget_char ( int c)
{
  ;

  /* Wrong when C == `\n'. */
  (calclloc) = last_yylloc;

  ungetc (c, input);
}

static int
read_signed_integer (void)
{
  int c = get_char ();
  int sign = 1;
  int n = 0;

  ;
  if (c == '-')
    {
      c = get_char ();
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char ();
    }

  unget_char ( c);

  return sign * n;
}


/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number.  Skips all   |
| blanks and tabs, returns 0 for EOF.                            |
`---------------------------------------------------------------*/

int
calclex (void)
{
  static int init = 1;
  int c;

  if (init)
    {
      init = 0;

      (calclloc).last_column = 1;
      (calclloc).last_line = 1;

    }


 (calclloc).first_column = (calclloc).last_column;
  (calclloc).first_line   = (calclloc).last_line;


  /* Skip white space.  */
  while ((c = get_char ()) == ' ' || c == '\t')
    {
     (calclloc).first_column = (calclloc).last_column;
      (calclloc).first_line   = (calclloc).last_line;

    }

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char ( c);
      (calclval).ival = read_signed_integer ();
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}
_ATEOF





if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/calc.at:581: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:581"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:581"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:581: bison --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:581"
( $at_check_trace; bison --xml=xml-tests/test.xml -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:581"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:581: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:581"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:581"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/calc.at:581: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:581"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:581"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/calc.at:581: bison -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:581"
( $at_check_trace; bison -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:581"
$at_failed && at_fn_log_failure
$at_traceon; }

   { set +x
$as_echo "$at_srcdir/calc.at:581: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c $LIBS" "calc.at:581"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:581"
$at_failed && at_fn_log_failure
$at_traceon; }



# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:581:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:581"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:581"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:581:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:581"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:581"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:581: cat stderr"
at_fn_check_prepare_trace "calc.at:581"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:581"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:581:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:581"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:581"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:581: cat stderr"
at_fn_check_prepare_trace "calc.at:581"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:581"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:581:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:581"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:581"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:581: cat stderr"
at_fn_check_prepare_trace "calc.at:581"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:581"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:581:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:581"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:581"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:581: cat stderr"
at_fn_check_prepare_trace "calc.at:581"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:581"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:581:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:581"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:581"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:581: cat stderr"
at_fn_check_prepare_trace "calc.at:581"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:581"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:581:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:581"
( $at_check_trace;  $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:581"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:581: cat stderr"
at_fn_check_prepare_trace "calc.at:581"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:581"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:581:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:581"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:581"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:581: cat stderr"
at_fn_check_prepare_trace "calc.at:581"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:581"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:581:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:581"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:581"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:581: cat stderr"
at_fn_check_prepare_trace "calc.at:581"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:581"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:581:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:581"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:581"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:581: cat stderr"
at_fn_check_prepare_trace "calc.at:581"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:581"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check that yyerrok works properly: second error is not reported,
# third and fourth are.  Parse status is succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:581:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:581"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:581"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:581: cat stderr"
at_fn_check_prepare_trace "calc.at:581"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:581"
$at_failed && at_fn_log_failure
$at_traceon; }



























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_129
#AT_START_130
# 130. calc.at:583: Calculator %debug
at_setup_line='calc.at:583'
at_fn_banner 10
at_desc="Calculator %debug"
at_desc_line="130: $at_desc                              "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "130. calc.at:583: testing ..."
  $at_traceon









# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.














cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%debug

%code requires {
/* Exercise pre-prologue dependency to %union.  */
typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};

%code provides {
#include <stdio.h>
/* The input.  */
extern FILE *input;
}

%code {
#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#else
# undef alarm
# define alarm(seconds) /* empty */
#endif
#define USE(Var)

FILE *input;
static semantic_value global_result = 0;
static int global_count = 0;
static int power (int base, int exponent);
/* yyerror receives the location if:
   - %location & %pure & %glr
   - %location & %pure & %yacc & %parse-param. */
static void yyerror (

                     const char *s
                     );
int yylex (void);
}



/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type  <ival> exp

%nonassoc '=' /* comparison	       */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line         {  }
;

line:
  '\n'
| exp '\n'           { USE ($1); }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static void
yyerror (

         const char *s)
{


  fprintf (stderr, "%s\n", s);
}

#include <ctype.h>

int yylex (void);
static int get_char (void);
static void unget_char ( int c);


static int
get_char (void)
{
  int res = getc (input);
  ;

  return res;
}

static void
unget_char ( int c)
{
  ;

  ungetc (c, input);
}

static int
read_signed_integer (void)
{
  int c = get_char ();
  int sign = 1;
  int n = 0;

  ;
  if (c == '-')
    {
      c = get_char ();
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char ();
    }

  unget_char ( c);

  return sign * n;
}


/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number.  Skips all   |
| blanks and tabs, returns 0 for EOF.                            |
`---------------------------------------------------------------*/

int
yylex (void)
{
  static int init = 1;
  int c;

  if (init)
    {
      init = 0;

    }



  /* Skip white space.  */
  while ((c = get_char ()) == ' ' || c == '\t')
    {

    }

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char ( c);
      (yylval).ival = read_signed_integer ();
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}


static int
power (int base, int exponent)
{
  int res = 1;
  if (exponent < 0)
    exit (3);
  for (/* Niente */; exponent; --exponent)
    res *= base;
  return res;
}


int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* This used to be alarm (10), but that isn't enough time for
     a July 1995 vintage DEC Alphastation 200 4/100 system,
     according to Nelson H. F. Beebe.  100 seconds is enough.  */
  alarm (100);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }

  yydebug = 1;
  status = yyparse ();
  fclose (input);
  if (global_result != result)
    abort ();
  if (global_count != count)
    abort ();
  return status;
}
_ATEOF






if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/calc.at:583: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:583"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:583"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:583: bison --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:583"
( $at_check_trace; bison --xml=xml-tests/test.xml -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:583"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:583: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:583"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:583"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/calc.at:583: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:583"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:583"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/calc.at:583: bison -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:583"
( $at_check_trace; bison -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:583"
$at_failed && at_fn_log_failure
$at_traceon; }

   { set +x
$as_echo "$at_srcdir/calc.at:583: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:583"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:583"
$at_failed && at_fn_log_failure
$at_traceon; }



# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:583:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:583"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:583"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:583:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:583"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:583"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:583: cat stderr"
at_fn_check_prepare_trace "calc.at:583"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:583"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:583:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:583"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:583"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:583: cat stderr"
at_fn_check_prepare_trace "calc.at:583"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:583"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:583:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:583"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:583"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:583: cat stderr"
at_fn_check_prepare_trace "calc.at:583"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:583"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:583:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:583"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:583"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:583: cat stderr"
at_fn_check_prepare_trace "calc.at:583"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:583"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:583:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:583"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:583"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:583: cat stderr"
at_fn_check_prepare_trace "calc.at:583"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:583"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:583:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:583"
( $at_check_trace;  $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:583"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:583: cat stderr"
at_fn_check_prepare_trace "calc.at:583"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:583"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:583:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:583"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:583"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:583: cat stderr"
at_fn_check_prepare_trace "calc.at:583"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:583"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:583:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:583"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:583"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:583: cat stderr"
at_fn_check_prepare_trace "calc.at:583"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:583"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:583:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:583"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:583"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:583: cat stderr"
at_fn_check_prepare_trace "calc.at:583"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:583"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check that yyerrok works properly: second error is not reported,
# third and fourth are.  Parse status is succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:583:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:583"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:583"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:583: cat stderr"
at_fn_check_prepare_trace "calc.at:583"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:583"
$at_failed && at_fn_log_failure
$at_traceon; }



























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_130
#AT_START_131
# 131. calc.at:584: Calculator %error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc
at_setup_line='calc.at:584'
at_fn_banner 10
at_desc="Calculator %error-verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc"
at_desc_line="131: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "131. calc.at:584: testing ..."
  $at_traceon









# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.














cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc

%code requires {
/* Exercise pre-prologue dependency to %union.  */
typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};

%code provides {
#include <stdio.h>
/* The input.  */
extern FILE *input;
}

%code {
#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#else
# undef alarm
# define alarm(seconds) /* empty */
#endif
#define USE(Var)

FILE *input;
static semantic_value global_result = 0;
static int global_count = 0;
static int power (int base, int exponent);
/* yyerror receives the location if:
   - %location & %pure & %glr
   - %location & %pure & %yacc & %parse-param. */
static void yyerror (

                     const char *s
                     );
int yylex (void);
}



/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type  <ival> exp

%nonassoc '=' /* comparison	       */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line         {  }
;

line:
  '\n'
| exp '\n'           { USE ($1); }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static void
yyerror (

         const char *s)
{


  fprintf (stderr, "%d.%d",
           (calclloc).first_line, (calclloc).first_column);
  if ((calclloc).first_line != (calclloc).last_line)
    fprintf (stderr, "-%d.%d",
	     (calclloc).last_line,  (calclloc).last_column - 1);
  else if ((calclloc).first_column != (calclloc).last_column - 1)
    fprintf (stderr, "-%d",
	     (calclloc).last_column - 1);
  fprintf (stderr, ": ");
  fprintf (stderr, "%s\n", s);
}



static int
power (int base, int exponent)
{
  int res = 1;
  if (exponent < 0)
    exit (3);
  for (/* Niente */; exponent; --exponent)
    res *= base;
  return res;
}


int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* This used to be alarm (10), but that isn't enough time for
     a July 1995 vintage DEC Alphastation 200 4/100 system,
     according to Nelson H. F. Beebe.  100 seconds is enough.  */
  alarm (100);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }

  yydebug = 1;
  status = yyparse ();
  fclose (input);
  if (global_result != result)
    abort ();
  if (global_count != count)
    abort ();
  return status;
}
_ATEOF


cat >calc-lex.c <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.h"

#include <ctype.h>

int calclex (void);
static int get_char (void);
static void unget_char ( int c);


static YYLTYPE last_yylloc;

static int
get_char (void)
{
  int res = getc (input);
  ;

  last_yylloc = (calclloc);
  if (res == '\n')
    {
      (calclloc).last_line++;
      (calclloc).last_column = 1;
    }
  else
    (calclloc).last_column++;

  return res;
}

static void
unget_char ( int c)
{
  ;

  /* Wrong when C == `\n'. */
  (calclloc) = last_yylloc;

  ungetc (c, input);
}

static int
read_signed_integer (void)
{
  int c = get_char ();
  int sign = 1;
  int n = 0;

  ;
  if (c == '-')
    {
      c = get_char ();
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char ();
    }

  unget_char ( c);

  return sign * n;
}


/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number.  Skips all   |
| blanks and tabs, returns 0 for EOF.                            |
`---------------------------------------------------------------*/

int
calclex (void)
{
  static int init = 1;
  int c;

  if (init)
    {
      init = 0;

      (calclloc).last_column = 1;
      (calclloc).last_line = 1;

    }


 (calclloc).first_column = (calclloc).last_column;
  (calclloc).first_line   = (calclloc).last_line;


  /* Skip white space.  */
  while ((c = get_char ()) == ' ' || c == '\t')
    {
     (calclloc).first_column = (calclloc).last_column;
      (calclloc).first_line   = (calclloc).last_line;

    }

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char ( c);
      (calclval).ival = read_signed_integer ();
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}
_ATEOF





if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/calc.at:584: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:584"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:584"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:584: bison --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:584"
( $at_check_trace; bison --xml=xml-tests/test.xml -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:584"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:584: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:584"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:584"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/calc.at:584: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:584"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:584"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/calc.at:584: bison -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:584"
( $at_check_trace; bison -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:584"
$at_failed && at_fn_log_failure
$at_traceon; }

   { set +x
$as_echo "$at_srcdir/calc.at:584: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c $LIBS" "calc.at:584"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:584"
$at_failed && at_fn_log_failure
$at_traceon; }



# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:584:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:584"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:584"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:584:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:584"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:584"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:584: cat stderr"
at_fn_check_prepare_trace "calc.at:584"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:584"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:584:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:584"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:584"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:584: cat stderr"
at_fn_check_prepare_trace "calc.at:584"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:584"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:584:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:584"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:584"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:584: cat stderr"
at_fn_check_prepare_trace "calc.at:584"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:584"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:584:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:584"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:584"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:584: cat stderr"
at_fn_check_prepare_trace "calc.at:584"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:584"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:584:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:584"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:584"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:584: cat stderr"
at_fn_check_prepare_trace "calc.at:584"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:584"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:584:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:584"
( $at_check_trace;  $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:584"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:584: cat stderr"
at_fn_check_prepare_trace "calc.at:584"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:584"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:584:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:584"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:584"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:584: cat stderr"
at_fn_check_prepare_trace "calc.at:584"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:584"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:584:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:584"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:584"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:584: cat stderr"
at_fn_check_prepare_trace "calc.at:584"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:584"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:584:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:584"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:584"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:584: cat stderr"
at_fn_check_prepare_trace "calc.at:584"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:584"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check that yyerrok works properly: second error is not reported,
# third and fourth are.  Parse status is succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:584:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:584"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:584"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:584: cat stderr"
at_fn_check_prepare_trace "calc.at:584"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:584"
$at_failed && at_fn_log_failure
$at_traceon; }



























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_131
#AT_START_132
# 132. calc.at:586: Calculator %define api.pure %error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc
at_setup_line='calc.at:586'
at_fn_banner 10
at_desc="Calculator %define api.pure %error-verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc"
at_desc_line="132: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "132. calc.at:586: testing ..."
  $at_traceon









# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.














cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%define api.pure %error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc

%code requires {
/* Exercise pre-prologue dependency to %union.  */
typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};

%code provides {
#include <stdio.h>
/* The input.  */
extern FILE *input;
}

%code {
#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#else
# undef alarm
# define alarm(seconds) /* empty */
#endif
#define USE(Var)

FILE *input;
static semantic_value global_result = 0;
static int global_count = 0;
static int power (int base, int exponent);
/* yyerror receives the location if:
   - %location & %pure & %glr
   - %location & %pure & %yacc & %parse-param. */
static void yyerror (

                     const char *s
                     );
int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
}



/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type  <ival> exp

%nonassoc '=' /* comparison	       */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line         {  }
;

line:
  '\n'
| exp '\n'           { USE ($1); }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static void
yyerror (

         const char *s)
{


  fprintf (stderr, "%s\n", s);
}



static int
power (int base, int exponent)
{
  int res = 1;
  if (exponent < 0)
    exit (3);
  for (/* Niente */; exponent; --exponent)
    res *= base;
  return res;
}


int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* This used to be alarm (10), but that isn't enough time for
     a July 1995 vintage DEC Alphastation 200 4/100 system,
     according to Nelson H. F. Beebe.  100 seconds is enough.  */
  alarm (100);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }

  yydebug = 1;
  status = yyparse ();
  fclose (input);
  if (global_result != result)
    abort ();
  if (global_count != count)
    abort ();
  return status;
}
_ATEOF


cat >calc-lex.c <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.h"

#include <ctype.h>

int calclex (YYSTYPE *lvalp, YYLTYPE *llocp);
static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp);
static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c);


static YYLTYPE last_yylloc;

static int
get_char (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int res = getc (input);
  (void) lvalp;(void) llocp;

  last_yylloc = (*llocp);
  if (res == '\n')
    {
      (*llocp).last_line++;
      (*llocp).last_column = 1;
    }
  else
    (*llocp).last_column++;

  return res;
}

static void
unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c)
{
  (void) lvalp;(void) llocp;

  /* Wrong when C == `\n'. */
  (*llocp) = last_yylloc;

  ungetc (c, input);
}

static int
read_signed_integer (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int c = get_char (lvalp, llocp);
  int sign = 1;
  int n = 0;

  (void) lvalp;(void) llocp;
  if (c == '-')
    {
      c = get_char (lvalp, llocp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp, llocp);
    }

  unget_char (lvalp, llocp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number.  Skips all   |
| blanks and tabs, returns 0 for EOF.                            |
`---------------------------------------------------------------*/

int
calclex (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  static int init = 1;
  int c;

  if (init)
    {
      init = 0;

      (*llocp).last_column = 1;
      (*llocp).last_line = 1;

    }


 (*llocp).first_column = (*llocp).last_column;
  (*llocp).first_line   = (*llocp).last_line;


  /* Skip white space.  */
  while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t')
    {
     (*llocp).first_column = (*llocp).last_column;
      (*llocp).first_line   = (*llocp).last_line;

    }

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp, llocp,  c);
      (*lvalp).ival = read_signed_integer (lvalp, llocp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}
_ATEOF





if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/calc.at:586: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:586"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:586"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:586: bison --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:586"
( $at_check_trace; bison --xml=xml-tests/test.xml -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:586"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:586: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:586"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:586"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/calc.at:586: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:586"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:586"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/calc.at:586: bison -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:586"
( $at_check_trace; bison -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:586"
$at_failed && at_fn_log_failure
$at_traceon; }

   { set +x
$as_echo "$at_srcdir/calc.at:586: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c $LIBS" "calc.at:586"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:586"
$at_failed && at_fn_log_failure
$at_traceon; }



# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:586:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:586"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:586"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:586:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:586"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:586"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:586: cat stderr"
at_fn_check_prepare_trace "calc.at:586"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:586"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:586:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:586"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:586"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:586: cat stderr"
at_fn_check_prepare_trace "calc.at:586"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:586"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:586:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:586"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:586"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:586: cat stderr"
at_fn_check_prepare_trace "calc.at:586"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:586"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:586:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:586"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:586"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:586: cat stderr"
at_fn_check_prepare_trace "calc.at:586"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:586"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:586:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:586"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:586"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:586: cat stderr"
at_fn_check_prepare_trace "calc.at:586"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:586"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:586:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:586"
( $at_check_trace;  $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:586"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:586: cat stderr"
at_fn_check_prepare_trace "calc.at:586"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:586"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:586:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:586"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:586"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:586: cat stderr"
at_fn_check_prepare_trace "calc.at:586"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:586"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:586:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:586"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:586"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:586: cat stderr"
at_fn_check_prepare_trace "calc.at:586"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:586"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:586:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:586"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:586"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:586: cat stderr"
at_fn_check_prepare_trace "calc.at:586"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:586"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check that yyerrok works properly: second error is not reported,
# third and fourth are.  Parse status is succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:586:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:586"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:586"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:586: cat stderr"
at_fn_check_prepare_trace "calc.at:586"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:586"
$at_failed && at_fn_log_failure
$at_traceon; }



























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_132
#AT_START_133
# 133. calc.at:587: Calculator %define api.push_pull "both" %define api.pure %error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc
at_setup_line='calc.at:587'
at_fn_banner 10
at_desc="Calculator %define api.push_pull \"both\" %define api.pure %error-verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc"
at_desc_line="133: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "133. calc.at:587: testing ..."
  $at_traceon









# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.














cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%define api.push_pull "both" %define api.pure %error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc

%code requires {
/* Exercise pre-prologue dependency to %union.  */
typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};

%code provides {
#include <stdio.h>
/* The input.  */
extern FILE *input;
}

%code {
#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#else
# undef alarm
# define alarm(seconds) /* empty */
#endif
#define USE(Var)

FILE *input;
static semantic_value global_result = 0;
static int global_count = 0;
static int power (int base, int exponent);
/* yyerror receives the location if:
   - %location & %pure & %glr
   - %location & %pure & %yacc & %parse-param. */
static void yyerror (

                     const char *s
                     );
int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
}



/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type  <ival> exp

%nonassoc '=' /* comparison	       */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line         {  }
;

line:
  '\n'
| exp '\n'           { USE ($1); }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static void
yyerror (

         const char *s)
{


  fprintf (stderr, "%s\n", s);
}



static int
power (int base, int exponent)
{
  int res = 1;
  if (exponent < 0)
    exit (3);
  for (/* Niente */; exponent; --exponent)
    res *= base;
  return res;
}


int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* This used to be alarm (10), but that isn't enough time for
     a July 1995 vintage DEC Alphastation 200 4/100 system,
     according to Nelson H. F. Beebe.  100 seconds is enough.  */
  alarm (100);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }

  yydebug = 1;
  status = yyparse ();
  fclose (input);
  if (global_result != result)
    abort ();
  if (global_count != count)
    abort ();
  return status;
}
_ATEOF


cat >calc-lex.c <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.h"

#include <ctype.h>

int calclex (YYSTYPE *lvalp, YYLTYPE *llocp);
static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp);
static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c);


static YYLTYPE last_yylloc;

static int
get_char (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int res = getc (input);
  (void) lvalp;(void) llocp;

  last_yylloc = (*llocp);
  if (res == '\n')
    {
      (*llocp).last_line++;
      (*llocp).last_column = 1;
    }
  else
    (*llocp).last_column++;

  return res;
}

static void
unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c)
{
  (void) lvalp;(void) llocp;

  /* Wrong when C == `\n'. */
  (*llocp) = last_yylloc;

  ungetc (c, input);
}

static int
read_signed_integer (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int c = get_char (lvalp, llocp);
  int sign = 1;
  int n = 0;

  (void) lvalp;(void) llocp;
  if (c == '-')
    {
      c = get_char (lvalp, llocp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp, llocp);
    }

  unget_char (lvalp, llocp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number.  Skips all   |
| blanks and tabs, returns 0 for EOF.                            |
`---------------------------------------------------------------*/

int
calclex (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  static int init = 1;
  int c;

  if (init)
    {
      init = 0;

      (*llocp).last_column = 1;
      (*llocp).last_line = 1;

    }


 (*llocp).first_column = (*llocp).last_column;
  (*llocp).first_line   = (*llocp).last_line;


  /* Skip white space.  */
  while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t')
    {
     (*llocp).first_column = (*llocp).last_column;
      (*llocp).first_line   = (*llocp).last_line;

    }

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp, llocp,  c);
      (*lvalp).ival = read_signed_integer (lvalp, llocp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}
_ATEOF





if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/calc.at:587: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:587"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:587"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:587: bison --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:587"
( $at_check_trace; bison --xml=xml-tests/test.xml -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:587"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:587: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:587"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:587"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/calc.at:587: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:587"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:587"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/calc.at:587: bison -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:587"
( $at_check_trace; bison -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:587"
$at_failed && at_fn_log_failure
$at_traceon; }

   { set +x
$as_echo "$at_srcdir/calc.at:587: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c $LIBS" "calc.at:587"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:587"
$at_failed && at_fn_log_failure
$at_traceon; }



# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:587:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:587"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:587"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:587:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:587"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:587"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:587: cat stderr"
at_fn_check_prepare_trace "calc.at:587"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:587"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:587:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:587"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:587"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:587: cat stderr"
at_fn_check_prepare_trace "calc.at:587"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:587"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:587:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:587"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:587"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:587: cat stderr"
at_fn_check_prepare_trace "calc.at:587"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:587"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:587:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:587"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:587"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:587: cat stderr"
at_fn_check_prepare_trace "calc.at:587"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:587"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:587:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:587"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:587"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:587: cat stderr"
at_fn_check_prepare_trace "calc.at:587"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:587"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:587:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:587"
( $at_check_trace;  $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:587"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:587: cat stderr"
at_fn_check_prepare_trace "calc.at:587"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:587"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:587:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:587"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:587"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:587: cat stderr"
at_fn_check_prepare_trace "calc.at:587"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:587"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:587:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:587"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:587"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:587: cat stderr"
at_fn_check_prepare_trace "calc.at:587"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:587"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:587:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:587"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:587"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:587: cat stderr"
at_fn_check_prepare_trace "calc.at:587"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:587"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check that yyerrok works properly: second error is not reported,
# third and fourth are.  Parse status is succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:587:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:587"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:587"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:587: cat stderr"
at_fn_check_prepare_trace "calc.at:587"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:587"
$at_failed && at_fn_log_failure
$at_traceon; }



























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_133
#AT_START_134
# 134. calc.at:589: Calculator %define api.pure %error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}
at_setup_line='calc.at:589'
at_fn_banner 10
at_desc="Calculator %define api.pure %error-verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}"
at_desc_line="134: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "134. calc.at:589: testing ..."
  $at_traceon









# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.














cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%define api.pure %error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}

%code requires {
/* Exercise pre-prologue dependency to %union.  */
typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};

%code provides {
#include <stdio.h>
/* The input.  */
extern FILE *input;
}

%code {
#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#else
# undef alarm
# define alarm(seconds) /* empty */
#endif
#define USE(Var)

FILE *input;
static semantic_value global_result = 0;
static int global_count = 0;
static int power (int base, int exponent);
/* yyerror receives the location if:
   - %location & %pure & %glr
   - %location & %pure & %yacc & %parse-param. */
static void yyerror (YYLTYPE *llocp,
                     semantic_value *result, int *count,
                     const char *s
                     );
int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
}



/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type  <ival> exp

%nonassoc '=' /* comparison	       */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line         { ++*count; ++global_count; }
;

line:
  '\n'
| exp '\n'           { *result = global_result = $1; }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static void
yyerror (YYLTYPE *llocp,
         semantic_value *result, int *count,
         const char *s)
{
(void) result; (void) count;

  fprintf (stderr, "%d.%d",
           (*llocp).first_line, (*llocp).first_column);
  if ((*llocp).first_line != (*llocp).last_line)
    fprintf (stderr, "-%d.%d",
	     (*llocp).last_line,  (*llocp).last_column - 1);
  else if ((*llocp).first_column != (*llocp).last_column - 1)
    fprintf (stderr, "-%d",
	     (*llocp).last_column - 1);
  fprintf (stderr, ": ");
  fprintf (stderr, "%s\n", s);
}



static int
power (int base, int exponent)
{
  int res = 1;
  if (exponent < 0)
    exit (3);
  for (/* Niente */; exponent; --exponent)
    res *= base;
  return res;
}


int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* This used to be alarm (10), but that isn't enough time for
     a July 1995 vintage DEC Alphastation 200 4/100 system,
     according to Nelson H. F. Beebe.  100 seconds is enough.  */
  alarm (100);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }

  yydebug = 1;
  status = yyparse (&result, &count);
  fclose (input);
  if (global_result != result)
    abort ();
  if (global_count != count)
    abort ();
  return status;
}
_ATEOF


cat >calc-lex.c <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.h"

#include <ctype.h>

int calclex (YYSTYPE *lvalp, YYLTYPE *llocp);
static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp);
static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c);


static YYLTYPE last_yylloc;

static int
get_char (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int res = getc (input);
  (void) lvalp;(void) llocp;

  last_yylloc = (*llocp);
  if (res == '\n')
    {
      (*llocp).last_line++;
      (*llocp).last_column = 1;
    }
  else
    (*llocp).last_column++;

  return res;
}

static void
unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c)
{
  (void) lvalp;(void) llocp;

  /* Wrong when C == `\n'. */
  (*llocp) = last_yylloc;

  ungetc (c, input);
}

static int
read_signed_integer (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int c = get_char (lvalp, llocp);
  int sign = 1;
  int n = 0;

  (void) lvalp;(void) llocp;
  if (c == '-')
    {
      c = get_char (lvalp, llocp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp, llocp);
    }

  unget_char (lvalp, llocp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number.  Skips all   |
| blanks and tabs, returns 0 for EOF.                            |
`---------------------------------------------------------------*/

int
calclex (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  static int init = 1;
  int c;

  if (init)
    {
      init = 0;

      (*llocp).last_column = 1;
      (*llocp).last_line = 1;

    }


 (*llocp).first_column = (*llocp).last_column;
  (*llocp).first_line   = (*llocp).last_line;


  /* Skip white space.  */
  while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t')
    {
     (*llocp).first_column = (*llocp).last_column;
      (*llocp).first_line   = (*llocp).last_line;

    }

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp, llocp,  c);
      (*lvalp).ival = read_signed_integer (lvalp, llocp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}
_ATEOF





if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/calc.at:589: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:589"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:589"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:589: bison --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:589"
( $at_check_trace; bison --xml=xml-tests/test.xml -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:589"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:589: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:589"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:589"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/calc.at:589: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:589"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:589"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/calc.at:589: bison -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:589"
( $at_check_trace; bison -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:589"
$at_failed && at_fn_log_failure
$at_traceon; }

   { set +x
$as_echo "$at_srcdir/calc.at:589: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c $LIBS" "calc.at:589"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:589"
$at_failed && at_fn_log_failure
$at_traceon; }



# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:589:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:589"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:589"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:589:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:589"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:589"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:589: cat stderr"
at_fn_check_prepare_trace "calc.at:589"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:589"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:589:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:589"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:589"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:589: cat stderr"
at_fn_check_prepare_trace "calc.at:589"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:589"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:589:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:589"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:589"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:589: cat stderr"
at_fn_check_prepare_trace "calc.at:589"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:589"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:589:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:589"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:589"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:589: cat stderr"
at_fn_check_prepare_trace "calc.at:589"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:589"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:589:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:589"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:589"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:589: cat stderr"
at_fn_check_prepare_trace "calc.at:589"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:589"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:589:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:589"
( $at_check_trace;  $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:589"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:589: cat stderr"
at_fn_check_prepare_trace "calc.at:589"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:589"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:589:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:589"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:589"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:589: cat stderr"
at_fn_check_prepare_trace "calc.at:589"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:589"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:589:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:589"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:589"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:589: cat stderr"
at_fn_check_prepare_trace "calc.at:589"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:589"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:589:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:589"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:589"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:589: cat stderr"
at_fn_check_prepare_trace "calc.at:589"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:589"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check that yyerrok works properly: second error is not reported,
# third and fourth are.  Parse status is succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:589:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:589"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:589"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:589: cat stderr"
at_fn_check_prepare_trace "calc.at:589"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:589"
$at_failed && at_fn_log_failure
$at_traceon; }



























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_134
#AT_START_135
# 135. calc.at:606: Calculator %glr-parser
at_setup_line='calc.at:606'
at_fn_banner 11
at_desc="Calculator %glr-parser "
at_desc_line="135: $at_desc                        "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "135. calc.at:606: testing ..."
  $at_traceon









# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.














cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%glr-parser

%code requires {
/* Exercise pre-prologue dependency to %union.  */
typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};

%code provides {
#include <stdio.h>
/* The input.  */
extern FILE *input;
}

%code {
#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#else
# undef alarm
# define alarm(seconds) /* empty */
#endif
#define USE(Var)

FILE *input;
static semantic_value global_result = 0;
static int global_count = 0;
static int power (int base, int exponent);
/* yyerror receives the location if:
   - %location & %pure & %glr
   - %location & %pure & %yacc & %parse-param. */
static void yyerror (

                     const char *s
                     );
int yylex (void);
}



/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type  <ival> exp

%nonassoc '=' /* comparison	       */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line         {  }
;

line:
  '\n'
| exp '\n'           { USE ($1); }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static void
yyerror (

         const char *s)
{


  fprintf (stderr, "%s\n", s);
}

#include <ctype.h>

int yylex (void);
static int get_char (void);
static void unget_char ( int c);


static int
get_char (void)
{
  int res = getc (input);
  ;

  return res;
}

static void
unget_char ( int c)
{
  ;

  ungetc (c, input);
}

static int
read_signed_integer (void)
{
  int c = get_char ();
  int sign = 1;
  int n = 0;

  ;
  if (c == '-')
    {
      c = get_char ();
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char ();
    }

  unget_char ( c);

  return sign * n;
}


/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number.  Skips all   |
| blanks and tabs, returns 0 for EOF.                            |
`---------------------------------------------------------------*/

int
yylex (void)
{
  static int init = 1;
  int c;

  if (init)
    {
      init = 0;

    }



  /* Skip white space.  */
  while ((c = get_char ()) == ' ' || c == '\t')
    {

    }

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char ( c);
      (yylval).ival = read_signed_integer ();
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}


static int
power (int base, int exponent)
{
  int res = 1;
  if (exponent < 0)
    exit (3);
  for (/* Niente */; exponent; --exponent)
    res *= base;
  return res;
}


int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* This used to be alarm (10), but that isn't enough time for
     a July 1995 vintage DEC Alphastation 200 4/100 system,
     according to Nelson H. F. Beebe.  100 seconds is enough.  */
  alarm (100);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  fclose (input);
  if (global_result != result)
    abort ();
  if (global_count != count)
    abort ();
  return status;
}
_ATEOF






if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/calc.at:606: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:606"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:606: bison --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:606"
( $at_check_trace; bison --xml=xml-tests/test.xml -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:606: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:606"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/calc.at:606: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:606"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/calc.at:606: bison -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:606"
( $at_check_trace; bison -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }

   { set +x
$as_echo "$at_srcdir/calc.at:606: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:606"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }



# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:606:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:606"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:606:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:606"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:606: cat stderr"
at_fn_check_prepare_trace "calc.at:606"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:606:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:606"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:606: cat stderr"
at_fn_check_prepare_trace "calc.at:606"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:606:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:606"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:606: cat stderr"
at_fn_check_prepare_trace "calc.at:606"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:606:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:606"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:606: cat stderr"
at_fn_check_prepare_trace "calc.at:606"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:606:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:606"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:606: cat stderr"
at_fn_check_prepare_trace "calc.at:606"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:606:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:606"
( $at_check_trace;  $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:606: cat stderr"
at_fn_check_prepare_trace "calc.at:606"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:606:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:606"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:606: cat stderr"
at_fn_check_prepare_trace "calc.at:606"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:606:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:606"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:606: cat stderr"
at_fn_check_prepare_trace "calc.at:606"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:606:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:606"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:606: cat stderr"
at_fn_check_prepare_trace "calc.at:606"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check that yyerrok works properly: second error is not reported,
# third and fourth are.  Parse status is succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:606:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:606"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:606: cat stderr"
at_fn_check_prepare_trace "calc.at:606"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }



























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_135
#AT_START_136
# 136. calc.at:608: Calculator %glr-parser %defines
at_setup_line='calc.at:608'
at_fn_banner 11
at_desc="Calculator %glr-parser %defines"
at_desc_line="136: $at_desc                "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "136. calc.at:608: testing ..."
  $at_traceon









# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.














cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%glr-parser %defines

%code requires {
/* Exercise pre-prologue dependency to %union.  */
typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};

%code provides {
#include <stdio.h>
/* The input.  */
extern FILE *input;
}

%code {
#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#else
# undef alarm
# define alarm(seconds) /* empty */
#endif
#define USE(Var)

FILE *input;
static semantic_value global_result = 0;
static int global_count = 0;
static int power (int base, int exponent);
/* yyerror receives the location if:
   - %location & %pure & %glr
   - %location & %pure & %yacc & %parse-param. */
static void yyerror (

                     const char *s
                     );
int yylex (void);
}



/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type  <ival> exp

%nonassoc '=' /* comparison	       */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line         {  }
;

line:
  '\n'
| exp '\n'           { USE ($1); }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static void
yyerror (

         const char *s)
{


  fprintf (stderr, "%s\n", s);
}



static int
power (int base, int exponent)
{
  int res = 1;
  if (exponent < 0)
    exit (3);
  for (/* Niente */; exponent; --exponent)
    res *= base;
  return res;
}


int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* This used to be alarm (10), but that isn't enough time for
     a July 1995 vintage DEC Alphastation 200 4/100 system,
     according to Nelson H. F. Beebe.  100 seconds is enough.  */
  alarm (100);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  fclose (input);
  if (global_result != result)
    abort ();
  if (global_count != count)
    abort ();
  return status;
}
_ATEOF


cat >calc-lex.c <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.h"

#include <ctype.h>

int yylex (void);
static int get_char (void);
static void unget_char ( int c);


static int
get_char (void)
{
  int res = getc (input);
  ;

  return res;
}

static void
unget_char ( int c)
{
  ;

  ungetc (c, input);
}

static int
read_signed_integer (void)
{
  int c = get_char ();
  int sign = 1;
  int n = 0;

  ;
  if (c == '-')
    {
      c = get_char ();
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char ();
    }

  unget_char ( c);

  return sign * n;
}


/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number.  Skips all   |
| blanks and tabs, returns 0 for EOF.                            |
`---------------------------------------------------------------*/

int
yylex (void)
{
  static int init = 1;
  int c;

  if (init)
    {
      init = 0;

    }



  /* Skip white space.  */
  while ((c = get_char ()) == ' ' || c == '\t')
    {

    }

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char ( c);
      (yylval).ival = read_signed_integer ();
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}
_ATEOF





if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/calc.at:608: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:608"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:608: bison --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:608"
( $at_check_trace; bison --xml=xml-tests/test.xml -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:608: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:608"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/calc.at:608: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:608"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/calc.at:608: bison -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:608"
( $at_check_trace; bison -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }

   { set +x
$as_echo "$at_srcdir/calc.at:608: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c $LIBS" "calc.at:608"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }



# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:608:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:608:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:608: cat stderr"
at_fn_check_prepare_trace "calc.at:608"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:608:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:608: cat stderr"
at_fn_check_prepare_trace "calc.at:608"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:608:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:608: cat stderr"
at_fn_check_prepare_trace "calc.at:608"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:608:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:608: cat stderr"
at_fn_check_prepare_trace "calc.at:608"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:608:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:608: cat stderr"
at_fn_check_prepare_trace "calc.at:608"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:608:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:608"
( $at_check_trace;  $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:608: cat stderr"
at_fn_check_prepare_trace "calc.at:608"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:608:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:608: cat stderr"
at_fn_check_prepare_trace "calc.at:608"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:608:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:608: cat stderr"
at_fn_check_prepare_trace "calc.at:608"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:608:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:608: cat stderr"
at_fn_check_prepare_trace "calc.at:608"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check that yyerrok works properly: second error is not reported,
# third and fourth are.  Parse status is succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:608:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:608"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:608: cat stderr"
at_fn_check_prepare_trace "calc.at:608"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }



























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_136
#AT_START_137
# 137. calc.at:609: Calculator %glr-parser %locations
at_setup_line='calc.at:609'
at_fn_banner 11
at_desc="Calculator %glr-parser %locations"
at_desc_line="137: $at_desc              "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "137. calc.at:609: testing ..."
  $at_traceon









# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.














cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%glr-parser %locations

%code requires {
/* Exercise pre-prologue dependency to %union.  */
typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};

%code provides {
#include <stdio.h>
/* The input.  */
extern FILE *input;
}

%code {
#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#else
# undef alarm
# define alarm(seconds) /* empty */
#endif
#define USE(Var)

FILE *input;
static semantic_value global_result = 0;
static int global_count = 0;
static int power (int base, int exponent);
/* yyerror receives the location if:
   - %location & %pure & %glr
   - %location & %pure & %yacc & %parse-param. */
static void yyerror (

                     const char *s
                     );
int yylex (void);
}



/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type  <ival> exp

%nonassoc '=' /* comparison	       */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line         {  }
;

line:
  '\n'
| exp '\n'           { USE ($1); }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static void
yyerror (

         const char *s)
{


  fprintf (stderr, "%d.%d",
           (yylloc).first_line, (yylloc).first_column);
  if ((yylloc).first_line != (yylloc).last_line)
    fprintf (stderr, "-%d.%d",
	     (yylloc).last_line,  (yylloc).last_column - 1);
  else if ((yylloc).first_column != (yylloc).last_column - 1)
    fprintf (stderr, "-%d",
	     (yylloc).last_column - 1);
  fprintf (stderr, ": ");
  fprintf (stderr, "%s\n", s);
}

#include <ctype.h>

int yylex (void);
static int get_char (void);
static void unget_char ( int c);


static YYLTYPE last_yylloc;

static int
get_char (void)
{
  int res = getc (input);
  ;

  last_yylloc = (yylloc);
  if (res == '\n')
    {
      (yylloc).last_line++;
      (yylloc).last_column = 1;
    }
  else
    (yylloc).last_column++;

  return res;
}

static void
unget_char ( int c)
{
  ;

  /* Wrong when C == `\n'. */
  (yylloc) = last_yylloc;

  ungetc (c, input);
}

static int
read_signed_integer (void)
{
  int c = get_char ();
  int sign = 1;
  int n = 0;

  ;
  if (c == '-')
    {
      c = get_char ();
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char ();
    }

  unget_char ( c);

  return sign * n;
}


/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number.  Skips all   |
| blanks and tabs, returns 0 for EOF.                            |
`---------------------------------------------------------------*/

int
yylex (void)
{
  static int init = 1;
  int c;

  if (init)
    {
      init = 0;

      (yylloc).last_column = 1;
      (yylloc).last_line = 1;

    }


 (yylloc).first_column = (yylloc).last_column;
  (yylloc).first_line   = (yylloc).last_line;


  /* Skip white space.  */
  while ((c = get_char ()) == ' ' || c == '\t')
    {
     (yylloc).first_column = (yylloc).last_column;
      (yylloc).first_line   = (yylloc).last_line;

    }

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char ( c);
      (yylval).ival = read_signed_integer ();
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}


static int
power (int base, int exponent)
{
  int res = 1;
  if (exponent < 0)
    exit (3);
  for (/* Niente */; exponent; --exponent)
    res *= base;
  return res;
}


int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* This used to be alarm (10), but that isn't enough time for
     a July 1995 vintage DEC Alphastation 200 4/100 system,
     according to Nelson H. F. Beebe.  100 seconds is enough.  */
  alarm (100);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  fclose (input);
  if (global_result != result)
    abort ();
  if (global_count != count)
    abort ();
  return status;
}
_ATEOF






if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/calc.at:609: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:609"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:609: bison --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:609"
( $at_check_trace; bison --xml=xml-tests/test.xml -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:609: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:609"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/calc.at:609: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:609"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/calc.at:609: bison -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:609"
( $at_check_trace; bison -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
$at_failed && at_fn_log_failure
$at_traceon; }

   { set +x
$as_echo "$at_srcdir/calc.at:609: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:609"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
$at_failed && at_fn_log_failure
$at_traceon; }



# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:609:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:609"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:609:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:609"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:609"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:609: cat stderr"
at_fn_check_prepare_trace "calc.at:609"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:609:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:609"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:609"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:609: cat stderr"
at_fn_check_prepare_trace "calc.at:609"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:609:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:609"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:609"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:609: cat stderr"
at_fn_check_prepare_trace "calc.at:609"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:609:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:609"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:609"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:609: cat stderr"
at_fn_check_prepare_trace "calc.at:609"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:609:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:609"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:609"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:609: cat stderr"
at_fn_check_prepare_trace "calc.at:609"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:609:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:609"
( $at_check_trace;  $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:609"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:609: cat stderr"
at_fn_check_prepare_trace "calc.at:609"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:609:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:609"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:609: cat stderr"
at_fn_check_prepare_trace "calc.at:609"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:609:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:609"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:609: cat stderr"
at_fn_check_prepare_trace "calc.at:609"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:609:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:609"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:609: cat stderr"
at_fn_check_prepare_trace "calc.at:609"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check that yyerrok works properly: second error is not reported,
# third and fourth are.  Parse status is succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:609:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:609"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:609: cat stderr"
at_fn_check_prepare_trace "calc.at:609"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:609"
$at_failed && at_fn_log_failure
$at_traceon; }



























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_137
#AT_START_138
# 138. calc.at:610: Calculator %glr-parser %name-prefix "calc"
at_setup_line='calc.at:610'
at_fn_banner 11
at_desc="Calculator %glr-parser %name-prefix \"calc\""
at_desc_line="138: $at_desc     "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "138. calc.at:610: testing ..."
  $at_traceon









# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.














cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%glr-parser %name-prefix "calc"

%code requires {
/* Exercise pre-prologue dependency to %union.  */
typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};

%code provides {
#include <stdio.h>
/* The input.  */
extern FILE *input;
}

%code {
#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#else
# undef alarm
# define alarm(seconds) /* empty */
#endif
#define USE(Var)

FILE *input;
static semantic_value global_result = 0;
static int global_count = 0;
static int power (int base, int exponent);
/* yyerror receives the location if:
   - %location & %pure & %glr
   - %location & %pure & %yacc & %parse-param. */
static void yyerror (

                     const char *s
                     );
int yylex (void);
}



/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type  <ival> exp

%nonassoc '=' /* comparison	       */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line         {  }
;

line:
  '\n'
| exp '\n'           { USE ($1); }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static void
yyerror (

         const char *s)
{


  fprintf (stderr, "%s\n", s);
}

#include <ctype.h>

int calclex (void);
static int get_char (void);
static void unget_char ( int c);


static int
get_char (void)
{
  int res = getc (input);
  ;

  return res;
}

static void
unget_char ( int c)
{
  ;

  ungetc (c, input);
}

static int
read_signed_integer (void)
{
  int c = get_char ();
  int sign = 1;
  int n = 0;

  ;
  if (c == '-')
    {
      c = get_char ();
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char ();
    }

  unget_char ( c);

  return sign * n;
}


/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number.  Skips all   |
| blanks and tabs, returns 0 for EOF.                            |
`---------------------------------------------------------------*/

int
calclex (void)
{
  static int init = 1;
  int c;

  if (init)
    {
      init = 0;

    }



  /* Skip white space.  */
  while ((c = get_char ()) == ' ' || c == '\t')
    {

    }

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char ( c);
      (calclval).ival = read_signed_integer ();
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}


static int
power (int base, int exponent)
{
  int res = 1;
  if (exponent < 0)
    exit (3);
  for (/* Niente */; exponent; --exponent)
    res *= base;
  return res;
}


int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* This used to be alarm (10), but that isn't enough time for
     a July 1995 vintage DEC Alphastation 200 4/100 system,
     according to Nelson H. F. Beebe.  100 seconds is enough.  */
  alarm (100);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  fclose (input);
  if (global_result != result)
    abort ();
  if (global_count != count)
    abort ();
  return status;
}
_ATEOF






if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/calc.at:610: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:610"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:610: bison --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:610"
( $at_check_trace; bison --xml=xml-tests/test.xml -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:610: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:610"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/calc.at:610: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:610"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/calc.at:610: bison -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:610"
( $at_check_trace; bison -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }

   { set +x
$as_echo "$at_srcdir/calc.at:610: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:610"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }



# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:610:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:610"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:610:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:610"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:610: cat stderr"
at_fn_check_prepare_trace "calc.at:610"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:610:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:610"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:610: cat stderr"
at_fn_check_prepare_trace "calc.at:610"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:610:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:610"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:610: cat stderr"
at_fn_check_prepare_trace "calc.at:610"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:610:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:610"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:610: cat stderr"
at_fn_check_prepare_trace "calc.at:610"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:610:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:610"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:610: cat stderr"
at_fn_check_prepare_trace "calc.at:610"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:610:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:610"
( $at_check_trace;  $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:610: cat stderr"
at_fn_check_prepare_trace "calc.at:610"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:610:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:610"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:610: cat stderr"
at_fn_check_prepare_trace "calc.at:610"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:610:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:610"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:610: cat stderr"
at_fn_check_prepare_trace "calc.at:610"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:610:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:610"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:610: cat stderr"
at_fn_check_prepare_trace "calc.at:610"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check that yyerrok works properly: second error is not reported,
# third and fourth are.  Parse status is succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:610:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:610"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:610: cat stderr"
at_fn_check_prepare_trace "calc.at:610"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:610"
$at_failed && at_fn_log_failure
$at_traceon; }



























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_138
#AT_START_139
# 139. calc.at:611: Calculator %glr-parser %verbose
at_setup_line='calc.at:611'
at_fn_banner 11
at_desc="Calculator %glr-parser %verbose"
at_desc_line="139: $at_desc                "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "139. calc.at:611: testing ..."
  $at_traceon









# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.














cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%glr-parser %verbose

%code requires {
/* Exercise pre-prologue dependency to %union.  */
typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};

%code provides {
#include <stdio.h>
/* The input.  */
extern FILE *input;
}

%code {
#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#else
# undef alarm
# define alarm(seconds) /* empty */
#endif
#define USE(Var)

FILE *input;
static semantic_value global_result = 0;
static int global_count = 0;
static int power (int base, int exponent);
/* yyerror receives the location if:
   - %location & %pure & %glr
   - %location & %pure & %yacc & %parse-param. */
static void yyerror (

                     const char *s
                     );
int yylex (void);
}



/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type  <ival> exp

%nonassoc '=' /* comparison	       */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line         {  }
;

line:
  '\n'
| exp '\n'           { USE ($1); }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static void
yyerror (

         const char *s)
{


  fprintf (stderr, "%s\n", s);
}

#include <ctype.h>

int yylex (void);
static int get_char (void);
static void unget_char ( int c);


static int
get_char (void)
{
  int res = getc (input);
  ;

  return res;
}

static void
unget_char ( int c)
{
  ;

  ungetc (c, input);
}

static int
read_signed_integer (void)
{
  int c = get_char ();
  int sign = 1;
  int n = 0;

  ;
  if (c == '-')
    {
      c = get_char ();
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char ();
    }

  unget_char ( c);

  return sign * n;
}


/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number.  Skips all   |
| blanks and tabs, returns 0 for EOF.                            |
`---------------------------------------------------------------*/

int
yylex (void)
{
  static int init = 1;
  int c;

  if (init)
    {
      init = 0;

    }



  /* Skip white space.  */
  while ((c = get_char ()) == ' ' || c == '\t')
    {

    }

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char ( c);
      (yylval).ival = read_signed_integer ();
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}


static int
power (int base, int exponent)
{
  int res = 1;
  if (exponent < 0)
    exit (3);
  for (/* Niente */; exponent; --exponent)
    res *= base;
  return res;
}


int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* This used to be alarm (10), but that isn't enough time for
     a July 1995 vintage DEC Alphastation 200 4/100 system,
     according to Nelson H. F. Beebe.  100 seconds is enough.  */
  alarm (100);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  fclose (input);
  if (global_result != result)
    abort ();
  if (global_count != count)
    abort ();
  return status;
}
_ATEOF






if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/calc.at:611: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:611"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:611: bison --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:611"
( $at_check_trace; bison --xml=xml-tests/test.xml -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:611: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:611"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/calc.at:611: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:611"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/calc.at:611: bison -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:611"
( $at_check_trace; bison -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }

   { set +x
$as_echo "$at_srcdir/calc.at:611: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:611"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }



# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:611:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:611:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:611: cat stderr"
at_fn_check_prepare_trace "calc.at:611"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:611:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:611: cat stderr"
at_fn_check_prepare_trace "calc.at:611"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:611:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:611: cat stderr"
at_fn_check_prepare_trace "calc.at:611"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:611:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:611: cat stderr"
at_fn_check_prepare_trace "calc.at:611"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:611:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:611: cat stderr"
at_fn_check_prepare_trace "calc.at:611"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:611:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:611"
( $at_check_trace;  $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:611: cat stderr"
at_fn_check_prepare_trace "calc.at:611"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:611:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:611: cat stderr"
at_fn_check_prepare_trace "calc.at:611"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:611:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:611: cat stderr"
at_fn_check_prepare_trace "calc.at:611"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:611:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:611: cat stderr"
at_fn_check_prepare_trace "calc.at:611"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check that yyerrok works properly: second error is not reported,
# third and fourth are.  Parse status is succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:611:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:611"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:611: cat stderr"
at_fn_check_prepare_trace "calc.at:611"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:611"
$at_failed && at_fn_log_failure
$at_traceon; }



























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_139
#AT_START_140
# 140. calc.at:612: Calculator %glr-parser %yacc
at_setup_line='calc.at:612'
at_fn_banner 11
at_desc="Calculator %glr-parser %yacc"
at_desc_line="140: $at_desc                   "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "140. calc.at:612: testing ..."
  $at_traceon









# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.














cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%glr-parser %yacc

%code requires {
/* Exercise pre-prologue dependency to %union.  */
typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};

%code provides {
#include <stdio.h>
/* The input.  */
extern FILE *input;
}

%code {
#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#else
# undef alarm
# define alarm(seconds) /* empty */
#endif
#define USE(Var)

FILE *input;
static semantic_value global_result = 0;
static int global_count = 0;
static int power (int base, int exponent);
/* yyerror receives the location if:
   - %location & %pure & %glr
   - %location & %pure & %yacc & %parse-param. */
static void yyerror (

                     const char *s
                     );
int yylex (void);
}



/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type  <ival> exp

%nonassoc '=' /* comparison	       */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line         {  }
;

line:
  '\n'
| exp '\n'           { USE ($1); }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static void
yyerror (

         const char *s)
{


  fprintf (stderr, "%s\n", s);
}

#include <ctype.h>

int yylex (void);
static int get_char (void);
static void unget_char ( int c);


static int
get_char (void)
{
  int res = getc (input);
  ;

  return res;
}

static void
unget_char ( int c)
{
  ;

  ungetc (c, input);
}

static int
read_signed_integer (void)
{
  int c = get_char ();
  int sign = 1;
  int n = 0;

  ;
  if (c == '-')
    {
      c = get_char ();
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char ();
    }

  unget_char ( c);

  return sign * n;
}


/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number.  Skips all   |
| blanks and tabs, returns 0 for EOF.                            |
`---------------------------------------------------------------*/

int
yylex (void)
{
  static int init = 1;
  int c;

  if (init)
    {
      init = 0;

    }



  /* Skip white space.  */
  while ((c = get_char ()) == ' ' || c == '\t')
    {

    }

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char ( c);
      (yylval).ival = read_signed_integer ();
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}


static int
power (int base, int exponent)
{
  int res = 1;
  if (exponent < 0)
    exit (3);
  for (/* Niente */; exponent; --exponent)
    res *= base;
  return res;
}


int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* This used to be alarm (10), but that isn't enough time for
     a July 1995 vintage DEC Alphastation 200 4/100 system,
     according to Nelson H. F. Beebe.  100 seconds is enough.  */
  alarm (100);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  fclose (input);
  if (global_result != result)
    abort ();
  if (global_count != count)
    abort ();
  return status;
}
_ATEOF






if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/calc.at:612: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:612"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:612: bison --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:612"
( $at_check_trace; bison --xml=xml-tests/test.xml -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:612: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:612"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/calc.at:612: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:612"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/calc.at:612: bison -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:612"
( $at_check_trace; bison -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
$at_failed && at_fn_log_failure
$at_traceon; }

   { set +x
$as_echo "$at_srcdir/calc.at:612: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:612"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
$at_failed && at_fn_log_failure
$at_traceon; }



# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:612:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:612"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:612:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:612"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:612"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:612: cat stderr"
at_fn_check_prepare_trace "calc.at:612"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:612:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:612"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:612"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:612: cat stderr"
at_fn_check_prepare_trace "calc.at:612"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:612:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:612"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:612"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:612: cat stderr"
at_fn_check_prepare_trace "calc.at:612"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:612:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:612"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:612"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:612: cat stderr"
at_fn_check_prepare_trace "calc.at:612"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:612:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:612"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:612"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:612: cat stderr"
at_fn_check_prepare_trace "calc.at:612"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:612:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:612"
( $at_check_trace;  $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:612"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:612: cat stderr"
at_fn_check_prepare_trace "calc.at:612"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:612:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:612"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:612: cat stderr"
at_fn_check_prepare_trace "calc.at:612"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:612:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:612"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:612: cat stderr"
at_fn_check_prepare_trace "calc.at:612"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:612:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:612"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:612: cat stderr"
at_fn_check_prepare_trace "calc.at:612"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check that yyerrok works properly: second error is not reported,
# third and fourth are.  Parse status is succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:612:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:612"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:612: cat stderr"
at_fn_check_prepare_trace "calc.at:612"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:612"
$at_failed && at_fn_log_failure
$at_traceon; }



























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_140
#AT_START_141
# 141. calc.at:613: Calculator %glr-parser %error-verbose
at_setup_line='calc.at:613'
at_fn_banner 11
at_desc="Calculator %glr-parser %error-verbose"
at_desc_line="141: $at_desc          "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "141. calc.at:613: testing ..."
  $at_traceon









# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.














cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%glr-parser %error-verbose

%code requires {
/* Exercise pre-prologue dependency to %union.  */
typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};

%code provides {
#include <stdio.h>
/* The input.  */
extern FILE *input;
}

%code {
#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#else
# undef alarm
# define alarm(seconds) /* empty */
#endif
#define USE(Var)

FILE *input;
static semantic_value global_result = 0;
static int global_count = 0;
static int power (int base, int exponent);
/* yyerror receives the location if:
   - %location & %pure & %glr
   - %location & %pure & %yacc & %parse-param. */
static void yyerror (

                     const char *s
                     );
int yylex (void);
}



/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type  <ival> exp

%nonassoc '=' /* comparison	       */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line         {  }
;

line:
  '\n'
| exp '\n'           { USE ($1); }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static void
yyerror (

         const char *s)
{


  fprintf (stderr, "%s\n", s);
}

#include <ctype.h>

int yylex (void);
static int get_char (void);
static void unget_char ( int c);


static int
get_char (void)
{
  int res = getc (input);
  ;

  return res;
}

static void
unget_char ( int c)
{
  ;

  ungetc (c, input);
}

static int
read_signed_integer (void)
{
  int c = get_char ();
  int sign = 1;
  int n = 0;

  ;
  if (c == '-')
    {
      c = get_char ();
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char ();
    }

  unget_char ( c);

  return sign * n;
}


/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number.  Skips all   |
| blanks and tabs, returns 0 for EOF.                            |
`---------------------------------------------------------------*/

int
yylex (void)
{
  static int init = 1;
  int c;

  if (init)
    {
      init = 0;

    }



  /* Skip white space.  */
  while ((c = get_char ()) == ' ' || c == '\t')
    {

    }

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char ( c);
      (yylval).ival = read_signed_integer ();
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}


static int
power (int base, int exponent)
{
  int res = 1;
  if (exponent < 0)
    exit (3);
  for (/* Niente */; exponent; --exponent)
    res *= base;
  return res;
}


int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* This used to be alarm (10), but that isn't enough time for
     a July 1995 vintage DEC Alphastation 200 4/100 system,
     according to Nelson H. F. Beebe.  100 seconds is enough.  */
  alarm (100);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  fclose (input);
  if (global_result != result)
    abort ();
  if (global_count != count)
    abort ();
  return status;
}
_ATEOF






if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/calc.at:613: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:613"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:613: bison --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:613"
( $at_check_trace; bison --xml=xml-tests/test.xml -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:613: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:613"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/calc.at:613: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:613"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/calc.at:613: bison -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:613"
( $at_check_trace; bison -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }

   { set +x
$as_echo "$at_srcdir/calc.at:613: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:613"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }



# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:613:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:613"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:613:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:613"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:613: cat stderr"
at_fn_check_prepare_trace "calc.at:613"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:613:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:613"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:613: cat stderr"
at_fn_check_prepare_trace "calc.at:613"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:613:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:613"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:613: cat stderr"
at_fn_check_prepare_trace "calc.at:613"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:613:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:613"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:613: cat stderr"
at_fn_check_prepare_trace "calc.at:613"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:613:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:613"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:613: cat stderr"
at_fn_check_prepare_trace "calc.at:613"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:613:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:613"
( $at_check_trace;  $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:613: cat stderr"
at_fn_check_prepare_trace "calc.at:613"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:613:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:613"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:613: cat stderr"
at_fn_check_prepare_trace "calc.at:613"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:613:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:613"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:613: cat stderr"
at_fn_check_prepare_trace "calc.at:613"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:613:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:613"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:613: cat stderr"
at_fn_check_prepare_trace "calc.at:613"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check that yyerrok works properly: second error is not reported,
# third and fourth are.  Parse status is succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:613:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:613"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:613: cat stderr"
at_fn_check_prepare_trace "calc.at:613"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }



























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_141
#AT_START_142
# 142. calc.at:615: Calculator %glr-parser %define api.pure %locations
at_setup_line='calc.at:615'
at_fn_banner 11
at_desc="Calculator %glr-parser %define api.pure %locations"
at_desc_line="142: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "142. calc.at:615: testing ..."
  $at_traceon









# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.














cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%glr-parser %define api.pure %locations

%code requires {
/* Exercise pre-prologue dependency to %union.  */
typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};

%code provides {
#include <stdio.h>
/* The input.  */
extern FILE *input;
}

%code {
#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#else
# undef alarm
# define alarm(seconds) /* empty */
#endif
#define USE(Var)

FILE *input;
static semantic_value global_result = 0;
static int global_count = 0;
static int power (int base, int exponent);
/* yyerror receives the location if:
   - %location & %pure & %glr
   - %location & %pure & %yacc & %parse-param. */
static void yyerror (YYLTYPE *llocp,

                     const char *s
                     );
int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
}



/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type  <ival> exp

%nonassoc '=' /* comparison	       */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line         {  }
;

line:
  '\n'
| exp '\n'           { USE ($1); }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static void
yyerror (YYLTYPE *llocp,

         const char *s)
{


  fprintf (stderr, "%d.%d",
           (*llocp).first_line, (*llocp).first_column);
  if ((*llocp).first_line != (*llocp).last_line)
    fprintf (stderr, "-%d.%d",
	     (*llocp).last_line,  (*llocp).last_column - 1);
  else if ((*llocp).first_column != (*llocp).last_column - 1)
    fprintf (stderr, "-%d",
	     (*llocp).last_column - 1);
  fprintf (stderr, ": ");
  fprintf (stderr, "%s\n", s);
}

#include <ctype.h>

int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp);
static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c);


static YYLTYPE last_yylloc;

static int
get_char (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int res = getc (input);
  (void) lvalp;(void) llocp;

  last_yylloc = (*llocp);
  if (res == '\n')
    {
      (*llocp).last_line++;
      (*llocp).last_column = 1;
    }
  else
    (*llocp).last_column++;

  return res;
}

static void
unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c)
{
  (void) lvalp;(void) llocp;

  /* Wrong when C == `\n'. */
  (*llocp) = last_yylloc;

  ungetc (c, input);
}

static int
read_signed_integer (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int c = get_char (lvalp, llocp);
  int sign = 1;
  int n = 0;

  (void) lvalp;(void) llocp;
  if (c == '-')
    {
      c = get_char (lvalp, llocp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp, llocp);
    }

  unget_char (lvalp, llocp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number.  Skips all   |
| blanks and tabs, returns 0 for EOF.                            |
`---------------------------------------------------------------*/

int
yylex (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  static int init = 1;
  int c;

  if (init)
    {
      init = 0;

      (*llocp).last_column = 1;
      (*llocp).last_line = 1;

    }


 (*llocp).first_column = (*llocp).last_column;
  (*llocp).first_line   = (*llocp).last_line;


  /* Skip white space.  */
  while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t')
    {
     (*llocp).first_column = (*llocp).last_column;
      (*llocp).first_line   = (*llocp).last_line;

    }

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp, llocp,  c);
      (*lvalp).ival = read_signed_integer (lvalp, llocp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}


static int
power (int base, int exponent)
{
  int res = 1;
  if (exponent < 0)
    exit (3);
  for (/* Niente */; exponent; --exponent)
    res *= base;
  return res;
}


int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* This used to be alarm (10), but that isn't enough time for
     a July 1995 vintage DEC Alphastation 200 4/100 system,
     according to Nelson H. F. Beebe.  100 seconds is enough.  */
  alarm (100);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  fclose (input);
  if (global_result != result)
    abort ();
  if (global_count != count)
    abort ();
  return status;
}
_ATEOF






if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/calc.at:615: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:615"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:615: bison --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:615"
( $at_check_trace; bison --xml=xml-tests/test.xml -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:615: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:615"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/calc.at:615: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:615"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/calc.at:615: bison -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:615"
( $at_check_trace; bison -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }

   { set +x
$as_echo "$at_srcdir/calc.at:615: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:615"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }



# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:615:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:615:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:615: cat stderr"
at_fn_check_prepare_trace "calc.at:615"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:615:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:615: cat stderr"
at_fn_check_prepare_trace "calc.at:615"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:615:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:615: cat stderr"
at_fn_check_prepare_trace "calc.at:615"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:615:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:615: cat stderr"
at_fn_check_prepare_trace "calc.at:615"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:615:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:615: cat stderr"
at_fn_check_prepare_trace "calc.at:615"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:615:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:615"
( $at_check_trace;  $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:615: cat stderr"
at_fn_check_prepare_trace "calc.at:615"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:615:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:615: cat stderr"
at_fn_check_prepare_trace "calc.at:615"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:615:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:615: cat stderr"
at_fn_check_prepare_trace "calc.at:615"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:615:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:615: cat stderr"
at_fn_check_prepare_trace "calc.at:615"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check that yyerrok works properly: second error is not reported,
# third and fourth are.  Parse status is succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:615:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:615"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:615: cat stderr"
at_fn_check_prepare_trace "calc.at:615"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }



























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_142
#AT_START_143
# 143. calc.at:616: Calculator %glr-parser %error-verbose %locations
at_setup_line='calc.at:616'
at_fn_banner 11
at_desc="Calculator %glr-parser %error-verbose %locations"
at_desc_line="143: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "143. calc.at:616: testing ..."
  $at_traceon









# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.














cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%glr-parser %error-verbose %locations

%code requires {
/* Exercise pre-prologue dependency to %union.  */
typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};

%code provides {
#include <stdio.h>
/* The input.  */
extern FILE *input;
}

%code {
#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#else
# undef alarm
# define alarm(seconds) /* empty */
#endif
#define USE(Var)

FILE *input;
static semantic_value global_result = 0;
static int global_count = 0;
static int power (int base, int exponent);
/* yyerror receives the location if:
   - %location & %pure & %glr
   - %location & %pure & %yacc & %parse-param. */
static void yyerror (

                     const char *s
                     );
int yylex (void);
}



/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type  <ival> exp

%nonassoc '=' /* comparison	       */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line         {  }
;

line:
  '\n'
| exp '\n'           { USE ($1); }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static void
yyerror (

         const char *s)
{


  fprintf (stderr, "%d.%d",
           (yylloc).first_line, (yylloc).first_column);
  if ((yylloc).first_line != (yylloc).last_line)
    fprintf (stderr, "-%d.%d",
	     (yylloc).last_line,  (yylloc).last_column - 1);
  else if ((yylloc).first_column != (yylloc).last_column - 1)
    fprintf (stderr, "-%d",
	     (yylloc).last_column - 1);
  fprintf (stderr, ": ");
  fprintf (stderr, "%s\n", s);
}

#include <ctype.h>

int yylex (void);
static int get_char (void);
static void unget_char ( int c);


static YYLTYPE last_yylloc;

static int
get_char (void)
{
  int res = getc (input);
  ;

  last_yylloc = (yylloc);
  if (res == '\n')
    {
      (yylloc).last_line++;
      (yylloc).last_column = 1;
    }
  else
    (yylloc).last_column++;

  return res;
}

static void
unget_char ( int c)
{
  ;

  /* Wrong when C == `\n'. */
  (yylloc) = last_yylloc;

  ungetc (c, input);
}

static int
read_signed_integer (void)
{
  int c = get_char ();
  int sign = 1;
  int n = 0;

  ;
  if (c == '-')
    {
      c = get_char ();
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char ();
    }

  unget_char ( c);

  return sign * n;
}


/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number.  Skips all   |
| blanks and tabs, returns 0 for EOF.                            |
`---------------------------------------------------------------*/

int
yylex (void)
{
  static int init = 1;
  int c;

  if (init)
    {
      init = 0;

      (yylloc).last_column = 1;
      (yylloc).last_line = 1;

    }


 (yylloc).first_column = (yylloc).last_column;
  (yylloc).first_line   = (yylloc).last_line;


  /* Skip white space.  */
  while ((c = get_char ()) == ' ' || c == '\t')
    {
     (yylloc).first_column = (yylloc).last_column;
      (yylloc).first_line   = (yylloc).last_line;

    }

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char ( c);
      (yylval).ival = read_signed_integer ();
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}


static int
power (int base, int exponent)
{
  int res = 1;
  if (exponent < 0)
    exit (3);
  for (/* Niente */; exponent; --exponent)
    res *= base;
  return res;
}


int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* This used to be alarm (10), but that isn't enough time for
     a July 1995 vintage DEC Alphastation 200 4/100 system,
     according to Nelson H. F. Beebe.  100 seconds is enough.  */
  alarm (100);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  fclose (input);
  if (global_result != result)
    abort ();
  if (global_count != count)
    abort ();
  return status;
}
_ATEOF






if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/calc.at:616: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:616"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:616: bison --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:616"
( $at_check_trace; bison --xml=xml-tests/test.xml -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:616: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:616"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/calc.at:616: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:616"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/calc.at:616: bison -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:616"
( $at_check_trace; bison -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
$at_failed && at_fn_log_failure
$at_traceon; }

   { set +x
$as_echo "$at_srcdir/calc.at:616: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:616"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
$at_failed && at_fn_log_failure
$at_traceon; }



# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:616:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:616"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:616:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:616"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:616"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:616: cat stderr"
at_fn_check_prepare_trace "calc.at:616"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:616:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:616"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:616"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:616: cat stderr"
at_fn_check_prepare_trace "calc.at:616"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:616:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:616"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:616"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:616: cat stderr"
at_fn_check_prepare_trace "calc.at:616"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:616:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:616"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:616"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:616: cat stderr"
at_fn_check_prepare_trace "calc.at:616"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:616:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:616"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:616"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:616: cat stderr"
at_fn_check_prepare_trace "calc.at:616"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:616:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:616"
( $at_check_trace;  $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:616"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:616: cat stderr"
at_fn_check_prepare_trace "calc.at:616"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:616:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:616"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:616: cat stderr"
at_fn_check_prepare_trace "calc.at:616"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:616:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:616"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:616: cat stderr"
at_fn_check_prepare_trace "calc.at:616"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:616:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:616"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:616: cat stderr"
at_fn_check_prepare_trace "calc.at:616"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check that yyerrok works properly: second error is not reported,
# third and fourth are.  Parse status is succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:616:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:616"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:616: cat stderr"
at_fn_check_prepare_trace "calc.at:616"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:616"
$at_failed && at_fn_log_failure
$at_traceon; }



























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_143
#AT_START_144
# 144. calc.at:618: Calculator %glr-parser %error-verbose %locations %defines %name-prefix "calc" %verbose %yacc
at_setup_line='calc.at:618'
at_fn_banner 11
at_desc="Calculator %glr-parser %error-verbose %locations %defines %name-prefix \"calc\" %verbose %yacc"
at_desc_line="144: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "144. calc.at:618: testing ..."
  $at_traceon









# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.














cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%glr-parser %error-verbose %locations %defines %name-prefix "calc" %verbose %yacc

%code requires {
/* Exercise pre-prologue dependency to %union.  */
typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};

%code provides {
#include <stdio.h>
/* The input.  */
extern FILE *input;
}

%code {
#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#else
# undef alarm
# define alarm(seconds) /* empty */
#endif
#define USE(Var)

FILE *input;
static semantic_value global_result = 0;
static int global_count = 0;
static int power (int base, int exponent);
/* yyerror receives the location if:
   - %location & %pure & %glr
   - %location & %pure & %yacc & %parse-param. */
static void yyerror (

                     const char *s
                     );
int yylex (void);
}



/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type  <ival> exp

%nonassoc '=' /* comparison	       */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line         {  }
;

line:
  '\n'
| exp '\n'           { USE ($1); }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static void
yyerror (

         const char *s)
{


  fprintf (stderr, "%d.%d",
           (calclloc).first_line, (calclloc).first_column);
  if ((calclloc).first_line != (calclloc).last_line)
    fprintf (stderr, "-%d.%d",
	     (calclloc).last_line,  (calclloc).last_column - 1);
  else if ((calclloc).first_column != (calclloc).last_column - 1)
    fprintf (stderr, "-%d",
	     (calclloc).last_column - 1);
  fprintf (stderr, ": ");
  fprintf (stderr, "%s\n", s);
}



static int
power (int base, int exponent)
{
  int res = 1;
  if (exponent < 0)
    exit (3);
  for (/* Niente */; exponent; --exponent)
    res *= base;
  return res;
}


int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* This used to be alarm (10), but that isn't enough time for
     a July 1995 vintage DEC Alphastation 200 4/100 system,
     according to Nelson H. F. Beebe.  100 seconds is enough.  */
  alarm (100);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  fclose (input);
  if (global_result != result)
    abort ();
  if (global_count != count)
    abort ();
  return status;
}
_ATEOF


cat >calc-lex.c <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.h"

#include <ctype.h>

int calclex (void);
static int get_char (void);
static void unget_char ( int c);


static YYLTYPE last_yylloc;

static int
get_char (void)
{
  int res = getc (input);
  ;

  last_yylloc = (calclloc);
  if (res == '\n')
    {
      (calclloc).last_line++;
      (calclloc).last_column = 1;
    }
  else
    (calclloc).last_column++;

  return res;
}

static void
unget_char ( int c)
{
  ;

  /* Wrong when C == `\n'. */
  (calclloc) = last_yylloc;

  ungetc (c, input);
}

static int
read_signed_integer (void)
{
  int c = get_char ();
  int sign = 1;
  int n = 0;

  ;
  if (c == '-')
    {
      c = get_char ();
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char ();
    }

  unget_char ( c);

  return sign * n;
}


/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number.  Skips all   |
| blanks and tabs, returns 0 for EOF.                            |
`---------------------------------------------------------------*/

int
calclex (void)
{
  static int init = 1;
  int c;

  if (init)
    {
      init = 0;

      (calclloc).last_column = 1;
      (calclloc).last_line = 1;

    }


 (calclloc).first_column = (calclloc).last_column;
  (calclloc).first_line   = (calclloc).last_line;


  /* Skip white space.  */
  while ((c = get_char ()) == ' ' || c == '\t')
    {
     (calclloc).first_column = (calclloc).last_column;
      (calclloc).first_line   = (calclloc).last_line;

    }

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char ( c);
      (calclval).ival = read_signed_integer ();
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}
_ATEOF





if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/calc.at:618: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:618"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:618: bison --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:618"
( $at_check_trace; bison --xml=xml-tests/test.xml -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:618: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:618"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/calc.at:618: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:618"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/calc.at:618: bison -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:618"
( $at_check_trace; bison -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }

   { set +x
$as_echo "$at_srcdir/calc.at:618: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c $LIBS" "calc.at:618"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }



# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:618:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:618:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:618: cat stderr"
at_fn_check_prepare_trace "calc.at:618"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:618:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:618: cat stderr"
at_fn_check_prepare_trace "calc.at:618"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:618:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:618: cat stderr"
at_fn_check_prepare_trace "calc.at:618"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:618:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:618: cat stderr"
at_fn_check_prepare_trace "calc.at:618"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:618:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:618: cat stderr"
at_fn_check_prepare_trace "calc.at:618"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:618:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:618"
( $at_check_trace;  $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:618: cat stderr"
at_fn_check_prepare_trace "calc.at:618"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:618:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:618: cat stderr"
at_fn_check_prepare_trace "calc.at:618"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:618:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:618: cat stderr"
at_fn_check_prepare_trace "calc.at:618"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:618:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:618: cat stderr"
at_fn_check_prepare_trace "calc.at:618"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check that yyerrok works properly: second error is not reported,
# third and fourth are.  Parse status is succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:618:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:618"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:618: cat stderr"
at_fn_check_prepare_trace "calc.at:618"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }



























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_144
#AT_START_145
# 145. calc.at:620: Calculator %glr-parser %debug
at_setup_line='calc.at:620'
at_fn_banner 11
at_desc="Calculator %glr-parser %debug"
at_desc_line="145: $at_desc                  "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "145. calc.at:620: testing ..."
  $at_traceon









# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.














cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%glr-parser %debug

%code requires {
/* Exercise pre-prologue dependency to %union.  */
typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};

%code provides {
#include <stdio.h>
/* The input.  */
extern FILE *input;
}

%code {
#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#else
# undef alarm
# define alarm(seconds) /* empty */
#endif
#define USE(Var)

FILE *input;
static semantic_value global_result = 0;
static int global_count = 0;
static int power (int base, int exponent);
/* yyerror receives the location if:
   - %location & %pure & %glr
   - %location & %pure & %yacc & %parse-param. */
static void yyerror (

                     const char *s
                     );
int yylex (void);
}



/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type  <ival> exp

%nonassoc '=' /* comparison	       */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line         {  }
;

line:
  '\n'
| exp '\n'           { USE ($1); }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static void
yyerror (

         const char *s)
{


  fprintf (stderr, "%s\n", s);
}

#include <ctype.h>

int yylex (void);
static int get_char (void);
static void unget_char ( int c);


static int
get_char (void)
{
  int res = getc (input);
  ;

  return res;
}

static void
unget_char ( int c)
{
  ;

  ungetc (c, input);
}

static int
read_signed_integer (void)
{
  int c = get_char ();
  int sign = 1;
  int n = 0;

  ;
  if (c == '-')
    {
      c = get_char ();
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char ();
    }

  unget_char ( c);

  return sign * n;
}


/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number.  Skips all   |
| blanks and tabs, returns 0 for EOF.                            |
`---------------------------------------------------------------*/

int
yylex (void)
{
  static int init = 1;
  int c;

  if (init)
    {
      init = 0;

    }



  /* Skip white space.  */
  while ((c = get_char ()) == ' ' || c == '\t')
    {

    }

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char ( c);
      (yylval).ival = read_signed_integer ();
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}


static int
power (int base, int exponent)
{
  int res = 1;
  if (exponent < 0)
    exit (3);
  for (/* Niente */; exponent; --exponent)
    res *= base;
  return res;
}


int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* This used to be alarm (10), but that isn't enough time for
     a July 1995 vintage DEC Alphastation 200 4/100 system,
     according to Nelson H. F. Beebe.  100 seconds is enough.  */
  alarm (100);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }

  yydebug = 1;
  status = yyparse ();
  fclose (input);
  if (global_result != result)
    abort ();
  if (global_count != count)
    abort ();
  return status;
}
_ATEOF






if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/calc.at:620: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:620"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:620: bison --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:620"
( $at_check_trace; bison --xml=xml-tests/test.xml -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:620: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:620"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/calc.at:620: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:620"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/calc.at:620: bison -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:620"
( $at_check_trace; bison -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }

   { set +x
$as_echo "$at_srcdir/calc.at:620: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:620"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }



# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:620:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:620"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:620:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:620"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:620: cat stderr"
at_fn_check_prepare_trace "calc.at:620"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:620:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:620"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:620: cat stderr"
at_fn_check_prepare_trace "calc.at:620"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:620:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:620"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:620: cat stderr"
at_fn_check_prepare_trace "calc.at:620"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:620:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:620"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:620: cat stderr"
at_fn_check_prepare_trace "calc.at:620"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:620:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:620"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:620: cat stderr"
at_fn_check_prepare_trace "calc.at:620"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:620:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:620"
( $at_check_trace;  $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:620: cat stderr"
at_fn_check_prepare_trace "calc.at:620"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:620:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:620"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:620: cat stderr"
at_fn_check_prepare_trace "calc.at:620"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:620:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:620"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:620: cat stderr"
at_fn_check_prepare_trace "calc.at:620"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:620:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:620"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:620: cat stderr"
at_fn_check_prepare_trace "calc.at:620"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check that yyerrok works properly: second error is not reported,
# third and fourth are.  Parse status is succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:620:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:620"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:620: cat stderr"
at_fn_check_prepare_trace "calc.at:620"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }



























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_145
#AT_START_146
# 146. calc.at:621: Calculator %glr-parser %error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc
at_setup_line='calc.at:621'
at_fn_banner 11
at_desc="Calculator %glr-parser %error-verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc"
at_desc_line="146: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "146. calc.at:621: testing ..."
  $at_traceon









# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.














cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%glr-parser %error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc

%code requires {
/* Exercise pre-prologue dependency to %union.  */
typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};

%code provides {
#include <stdio.h>
/* The input.  */
extern FILE *input;
}

%code {
#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#else
# undef alarm
# define alarm(seconds) /* empty */
#endif
#define USE(Var)

FILE *input;
static semantic_value global_result = 0;
static int global_count = 0;
static int power (int base, int exponent);
/* yyerror receives the location if:
   - %location & %pure & %glr
   - %location & %pure & %yacc & %parse-param. */
static void yyerror (

                     const char *s
                     );
int yylex (void);
}



/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type  <ival> exp

%nonassoc '=' /* comparison	       */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line         {  }
;

line:
  '\n'
| exp '\n'           { USE ($1); }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static void
yyerror (

         const char *s)
{


  fprintf (stderr, "%d.%d",
           (calclloc).first_line, (calclloc).first_column);
  if ((calclloc).first_line != (calclloc).last_line)
    fprintf (stderr, "-%d.%d",
	     (calclloc).last_line,  (calclloc).last_column - 1);
  else if ((calclloc).first_column != (calclloc).last_column - 1)
    fprintf (stderr, "-%d",
	     (calclloc).last_column - 1);
  fprintf (stderr, ": ");
  fprintf (stderr, "%s\n", s);
}



static int
power (int base, int exponent)
{
  int res = 1;
  if (exponent < 0)
    exit (3);
  for (/* Niente */; exponent; --exponent)
    res *= base;
  return res;
}


int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* This used to be alarm (10), but that isn't enough time for
     a July 1995 vintage DEC Alphastation 200 4/100 system,
     according to Nelson H. F. Beebe.  100 seconds is enough.  */
  alarm (100);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }

  yydebug = 1;
  status = yyparse ();
  fclose (input);
  if (global_result != result)
    abort ();
  if (global_count != count)
    abort ();
  return status;
}
_ATEOF


cat >calc-lex.c <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.h"

#include <ctype.h>

int calclex (void);
static int get_char (void);
static void unget_char ( int c);


static YYLTYPE last_yylloc;

static int
get_char (void)
{
  int res = getc (input);
  ;

  last_yylloc = (calclloc);
  if (res == '\n')
    {
      (calclloc).last_line++;
      (calclloc).last_column = 1;
    }
  else
    (calclloc).last_column++;

  return res;
}

static void
unget_char ( int c)
{
  ;

  /* Wrong when C == `\n'. */
  (calclloc) = last_yylloc;

  ungetc (c, input);
}

static int
read_signed_integer (void)
{
  int c = get_char ();
  int sign = 1;
  int n = 0;

  ;
  if (c == '-')
    {
      c = get_char ();
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char ();
    }

  unget_char ( c);

  return sign * n;
}


/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number.  Skips all   |
| blanks and tabs, returns 0 for EOF.                            |
`---------------------------------------------------------------*/

int
calclex (void)
{
  static int init = 1;
  int c;

  if (init)
    {
      init = 0;

      (calclloc).last_column = 1;
      (calclloc).last_line = 1;

    }


 (calclloc).first_column = (calclloc).last_column;
  (calclloc).first_line   = (calclloc).last_line;


  /* Skip white space.  */
  while ((c = get_char ()) == ' ' || c == '\t')
    {
     (calclloc).first_column = (calclloc).last_column;
      (calclloc).first_line   = (calclloc).last_line;

    }

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char ( c);
      (calclval).ival = read_signed_integer ();
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}
_ATEOF





if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/calc.at:621: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:621"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:621: bison --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:621"
( $at_check_trace; bison --xml=xml-tests/test.xml -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:621: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:621"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/calc.at:621: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:621"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/calc.at:621: bison -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:621"
( $at_check_trace; bison -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
$at_failed && at_fn_log_failure
$at_traceon; }

   { set +x
$as_echo "$at_srcdir/calc.at:621: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c $LIBS" "calc.at:621"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
$at_failed && at_fn_log_failure
$at_traceon; }



# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:621:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:621"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:621:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:621"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:621"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:621: cat stderr"
at_fn_check_prepare_trace "calc.at:621"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:621:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:621"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:621"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:621: cat stderr"
at_fn_check_prepare_trace "calc.at:621"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:621:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:621"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:621"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:621: cat stderr"
at_fn_check_prepare_trace "calc.at:621"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:621:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:621"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:621"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:621: cat stderr"
at_fn_check_prepare_trace "calc.at:621"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:621:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:621"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:621"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:621: cat stderr"
at_fn_check_prepare_trace "calc.at:621"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:621:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:621"
( $at_check_trace;  $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:621"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:621: cat stderr"
at_fn_check_prepare_trace "calc.at:621"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:621:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:621"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:621: cat stderr"
at_fn_check_prepare_trace "calc.at:621"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:621:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:621"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:621: cat stderr"
at_fn_check_prepare_trace "calc.at:621"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:621:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:621"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:621: cat stderr"
at_fn_check_prepare_trace "calc.at:621"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check that yyerrok works properly: second error is not reported,
# third and fourth are.  Parse status is succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:621:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:621"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:621: cat stderr"
at_fn_check_prepare_trace "calc.at:621"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:621"
$at_failed && at_fn_log_failure
$at_traceon; }



























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_146
#AT_START_147
# 147. calc.at:623: Calculator %glr-parser %define api.pure %error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc
at_setup_line='calc.at:623'
at_fn_banner 11
at_desc="Calculator %glr-parser %define api.pure %error-verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc"
at_desc_line="147: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "147. calc.at:623: testing ..."
  $at_traceon









# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.














cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%glr-parser %define api.pure %error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc

%code requires {
/* Exercise pre-prologue dependency to %union.  */
typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};

%code provides {
#include <stdio.h>
/* The input.  */
extern FILE *input;
}

%code {
#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#else
# undef alarm
# define alarm(seconds) /* empty */
#endif
#define USE(Var)

FILE *input;
static semantic_value global_result = 0;
static int global_count = 0;
static int power (int base, int exponent);
/* yyerror receives the location if:
   - %location & %pure & %glr
   - %location & %pure & %yacc & %parse-param. */
static void yyerror (YYLTYPE *llocp,

                     const char *s
                     );
int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
}



/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type  <ival> exp

%nonassoc '=' /* comparison	       */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line         {  }
;

line:
  '\n'
| exp '\n'           { USE ($1); }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static void
yyerror (YYLTYPE *llocp,

         const char *s)
{


  fprintf (stderr, "%d.%d",
           (*llocp).first_line, (*llocp).first_column);
  if ((*llocp).first_line != (*llocp).last_line)
    fprintf (stderr, "-%d.%d",
	     (*llocp).last_line,  (*llocp).last_column - 1);
  else if ((*llocp).first_column != (*llocp).last_column - 1)
    fprintf (stderr, "-%d",
	     (*llocp).last_column - 1);
  fprintf (stderr, ": ");
  fprintf (stderr, "%s\n", s);
}



static int
power (int base, int exponent)
{
  int res = 1;
  if (exponent < 0)
    exit (3);
  for (/* Niente */; exponent; --exponent)
    res *= base;
  return res;
}


int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* This used to be alarm (10), but that isn't enough time for
     a July 1995 vintage DEC Alphastation 200 4/100 system,
     according to Nelson H. F. Beebe.  100 seconds is enough.  */
  alarm (100);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }

  yydebug = 1;
  status = yyparse ();
  fclose (input);
  if (global_result != result)
    abort ();
  if (global_count != count)
    abort ();
  return status;
}
_ATEOF


cat >calc-lex.c <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.h"

#include <ctype.h>

int calclex (YYSTYPE *lvalp, YYLTYPE *llocp);
static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp);
static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c);


static YYLTYPE last_yylloc;

static int
get_char (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int res = getc (input);
  (void) lvalp;(void) llocp;

  last_yylloc = (*llocp);
  if (res == '\n')
    {
      (*llocp).last_line++;
      (*llocp).last_column = 1;
    }
  else
    (*llocp).last_column++;

  return res;
}

static void
unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c)
{
  (void) lvalp;(void) llocp;

  /* Wrong when C == `\n'. */
  (*llocp) = last_yylloc;

  ungetc (c, input);
}

static int
read_signed_integer (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int c = get_char (lvalp, llocp);
  int sign = 1;
  int n = 0;

  (void) lvalp;(void) llocp;
  if (c == '-')
    {
      c = get_char (lvalp, llocp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp, llocp);
    }

  unget_char (lvalp, llocp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number.  Skips all   |
| blanks and tabs, returns 0 for EOF.                            |
`---------------------------------------------------------------*/

int
calclex (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  static int init = 1;
  int c;

  if (init)
    {
      init = 0;

      (*llocp).last_column = 1;
      (*llocp).last_line = 1;

    }


 (*llocp).first_column = (*llocp).last_column;
  (*llocp).first_line   = (*llocp).last_line;


  /* Skip white space.  */
  while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t')
    {
     (*llocp).first_column = (*llocp).last_column;
      (*llocp).first_line   = (*llocp).last_line;

    }

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp, llocp,  c);
      (*lvalp).ival = read_signed_integer (lvalp, llocp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}
_ATEOF





if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/calc.at:623: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:623"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:623"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:623: bison --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:623"
( $at_check_trace; bison --xml=xml-tests/test.xml -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:623"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:623: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:623"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:623"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/calc.at:623: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:623"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:623"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/calc.at:623: bison -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:623"
( $at_check_trace; bison -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:623"
$at_failed && at_fn_log_failure
$at_traceon; }

   { set +x
$as_echo "$at_srcdir/calc.at:623: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c $LIBS" "calc.at:623"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:623"
$at_failed && at_fn_log_failure
$at_traceon; }



# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:623:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:623"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:623"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:623:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:623"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:623"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:623: cat stderr"
at_fn_check_prepare_trace "calc.at:623"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:623"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:623:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:623"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:623"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:623: cat stderr"
at_fn_check_prepare_trace "calc.at:623"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:623"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:623:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:623"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:623"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:623: cat stderr"
at_fn_check_prepare_trace "calc.at:623"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:623"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:623:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:623"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:623"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:623: cat stderr"
at_fn_check_prepare_trace "calc.at:623"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:623"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:623:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:623"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:623"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:623: cat stderr"
at_fn_check_prepare_trace "calc.at:623"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:623"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:623:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:623"
( $at_check_trace;  $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:623"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:623: cat stderr"
at_fn_check_prepare_trace "calc.at:623"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:623"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:623:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:623"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:623"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:623: cat stderr"
at_fn_check_prepare_trace "calc.at:623"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:623"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:623:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:623"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:623"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:623: cat stderr"
at_fn_check_prepare_trace "calc.at:623"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:623"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:623:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:623"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:623"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:623: cat stderr"
at_fn_check_prepare_trace "calc.at:623"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:623"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check that yyerrok works properly: second error is not reported,
# third and fourth are.  Parse status is succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:623:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:623"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:623"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:623: cat stderr"
at_fn_check_prepare_trace "calc.at:623"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:623"
$at_failed && at_fn_log_failure
$at_traceon; }



























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_147
#AT_START_148
# 148. calc.at:625: Calculator %glr-parser %define api.pure %error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}
at_setup_line='calc.at:625'
at_fn_banner 11
at_desc="Calculator %glr-parser %define api.pure %error-verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}"
at_desc_line="148: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "148. calc.at:625: testing ..."
  $at_traceon









# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.














cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%glr-parser %define api.pure %error-verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}

%code requires {
/* Exercise pre-prologue dependency to %union.  */
typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};

%code provides {
#include <stdio.h>
/* The input.  */
extern FILE *input;
}

%code {
#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#else
# undef alarm
# define alarm(seconds) /* empty */
#endif
#define USE(Var)

FILE *input;
static semantic_value global_result = 0;
static int global_count = 0;
static int power (int base, int exponent);
/* yyerror receives the location if:
   - %location & %pure & %glr
   - %location & %pure & %yacc & %parse-param. */
static void yyerror (YYLTYPE *llocp,
                     semantic_value *result, int *count,
                     const char *s
                     );
int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
}



/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type  <ival> exp

%nonassoc '=' /* comparison	       */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line         { ++*count; ++global_count; }
;

line:
  '\n'
| exp '\n'           { *result = global_result = $1; }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

static void
yyerror (YYLTYPE *llocp,
         semantic_value *result, int *count,
         const char *s)
{
(void) result; (void) count;

  fprintf (stderr, "%d.%d",
           (*llocp).first_line, (*llocp).first_column);
  if ((*llocp).first_line != (*llocp).last_line)
    fprintf (stderr, "-%d.%d",
	     (*llocp).last_line,  (*llocp).last_column - 1);
  else if ((*llocp).first_column != (*llocp).last_column - 1)
    fprintf (stderr, "-%d",
	     (*llocp).last_column - 1);
  fprintf (stderr, ": ");
  fprintf (stderr, "%s\n", s);
}



static int
power (int base, int exponent)
{
  int res = 1;
  if (exponent < 0)
    exit (3);
  for (/* Niente */; exponent; --exponent)
    res *= base;
  return res;
}


int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* This used to be alarm (10), but that isn't enough time for
     a July 1995 vintage DEC Alphastation 200 4/100 system,
     according to Nelson H. F. Beebe.  100 seconds is enough.  */
  alarm (100);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }

  yydebug = 1;
  status = yyparse (&result, &count);
  fclose (input);
  if (global_result != result)
    abort ();
  if (global_count != count)
    abort ();
  return status;
}
_ATEOF


cat >calc-lex.c <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.h"

#include <ctype.h>

int calclex (YYSTYPE *lvalp, YYLTYPE *llocp);
static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp);
static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c);


static YYLTYPE last_yylloc;

static int
get_char (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int res = getc (input);
  (void) lvalp;(void) llocp;

  last_yylloc = (*llocp);
  if (res == '\n')
    {
      (*llocp).last_line++;
      (*llocp).last_column = 1;
    }
  else
    (*llocp).last_column++;

  return res;
}

static void
unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c)
{
  (void) lvalp;(void) llocp;

  /* Wrong when C == `\n'. */
  (*llocp) = last_yylloc;

  ungetc (c, input);
}

static int
read_signed_integer (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int c = get_char (lvalp, llocp);
  int sign = 1;
  int n = 0;

  (void) lvalp;(void) llocp;
  if (c == '-')
    {
      c = get_char (lvalp, llocp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp, llocp);
    }

  unget_char (lvalp, llocp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number.  Skips all   |
| blanks and tabs, returns 0 for EOF.                            |
`---------------------------------------------------------------*/

int
calclex (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  static int init = 1;
  int c;

  if (init)
    {
      init = 0;

      (*llocp).last_column = 1;
      (*llocp).last_line = 1;

    }


 (*llocp).first_column = (*llocp).last_column;
  (*llocp).first_line   = (*llocp).last_line;


  /* Skip white space.  */
  while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t')
    {
     (*llocp).first_column = (*llocp).last_column;
      (*llocp).first_line   = (*llocp).last_line;

    }

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp, llocp,  c);
      (*lvalp).ival = read_signed_integer (lvalp, llocp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}
_ATEOF





if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/calc.at:625: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:625"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:625"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:625: bison --xml=xml-tests/test.xml -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:625"
( $at_check_trace; bison --xml=xml-tests/test.xml -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:625"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:625: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:625"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:625"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/calc.at:625: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:625"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:625"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/calc.at:625: bison -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:625"
( $at_check_trace; bison -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:625"
$at_failed && at_fn_log_failure
$at_traceon; }

   { set +x
$as_echo "$at_srcdir/calc.at:625: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c $LIBS" "calc.at:625"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:625"
$at_failed && at_fn_log_failure
$at_traceon; }



# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:625:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:625"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:625"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:625:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:625"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:625"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:625: cat stderr"
at_fn_check_prepare_trace "calc.at:625"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:625"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:625:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:625"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:625"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:625: cat stderr"
at_fn_check_prepare_trace "calc.at:625"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:625"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:625:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:625"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:625"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:625: cat stderr"
at_fn_check_prepare_trace "calc.at:625"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:625"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:625:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:625"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:625"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:625: cat stderr"
at_fn_check_prepare_trace "calc.at:625"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:625"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:625:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:625"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:625"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:625: cat stderr"
at_fn_check_prepare_trace "calc.at:625"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:625"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:625:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:625"
( $at_check_trace;  $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:625"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:625: cat stderr"
at_fn_check_prepare_trace "calc.at:625"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:625"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:625:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:625"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:625"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:625: cat stderr"
at_fn_check_prepare_trace "calc.at:625"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:625"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:625:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:625"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:625"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:625: cat stderr"
at_fn_check_prepare_trace "calc.at:625"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:625"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:625:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:625"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:625"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:625: cat stderr"
at_fn_check_prepare_trace "calc.at:625"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:625"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check that yyerrok works properly: second error is not reported,
# third and fourth are.  Parse status is succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:625:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:625"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:625"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:625: cat stderr"
at_fn_check_prepare_trace "calc.at:625"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:625"
$at_failed && at_fn_log_failure
$at_traceon; }



























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_148
#AT_START_149
# 149. calc.at:635: Calculator %skeleton "lalr1.cc" %defines %locations
at_setup_line='calc.at:635'
at_fn_banner 12
at_desc="Calculator %skeleton \"lalr1.cc\" %defines %locations"
at_desc_line="149: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "149. calc.at:635: testing ..."
  $at_traceon









# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.














cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%skeleton "lalr1.cc" %defines %locations
%define global_tokens_and_yystype
%code requires {
/* Exercise pre-prologue dependency to %union.  */
typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};

%code provides {
#include <stdio.h>
/* The input.  */
extern FILE *input;
#ifndef YYLTYPE
# define YYLTYPE yy::location
#endif
#define first_line   begin.line
#define first_column begin.column
#define last_line    end.line
#define last_column  end.column
}

%code {
#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#else
# undef alarm
# define alarm(seconds) /* empty */
#endif
#define USE(Var)

FILE *input;
static semantic_value global_result = 0;
static int global_count = 0;
static int power (int base, int exponent);

int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
}

/* The lalr1.cc skeleton, for backward compatibility, defines
   a constructor for position that initializes the filename.  The
   glr.cc skeleton does not (and in fact cannot: location/position
   are stored in a union, from which objects with constructors are
   excluded in C++. */
%initial-action {
  @$.initialize (0);
}


/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type  <ival> exp

%nonassoc '=' /* comparison	       */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line         {  }
;

line:
  '\n'
| exp '\n'           { USE ($1); }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

/* A C++ error reporting function.  */
void
yy::parser::error (const location& l, const std::string& m)
{
  (void) l;
  std::cerr << l << ": " << m << std::endl;
}

int
yyparse ()
{
  yy::parser parser;
#if YYDEBUG
  parser.set_debug_level (1);
#endif
  return parser.parse ();
}




static int
power (int base, int exponent)
{
  int res = 1;
  if (exponent < 0)
    exit (3);
  for (/* Niente */; exponent; --exponent)
    res *= base;
  return res;
}


int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* This used to be alarm (10), but that isn't enough time for
     a July 1995 vintage DEC Alphastation 200 4/100 system,
     according to Nelson H. F. Beebe.  100 seconds is enough.  */
  alarm (100);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  fclose (input);
  if (global_result != result)
    abort ();
  if (global_count != count)
    abort ();
  return status;
}
_ATEOF


cat >calc-lex.cc <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.hh"

#include <ctype.h>

int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp);
static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c);


static YYLTYPE last_yylloc;

static int
get_char (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int res = getc (input);
  (void) lvalp;(void) llocp;

  last_yylloc = (*llocp);
  if (res == '\n')
    {
      (*llocp).last_line++;
      (*llocp).last_column = 1;
    }
  else
    (*llocp).last_column++;

  return res;
}

static void
unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c)
{
  (void) lvalp;(void) llocp;

  /* Wrong when C == `\n'. */
  (*llocp) = last_yylloc;

  ungetc (c, input);
}

static int
read_signed_integer (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int c = get_char (lvalp, llocp);
  int sign = 1;
  int n = 0;

  (void) lvalp;(void) llocp;
  if (c == '-')
    {
      c = get_char (lvalp, llocp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp, llocp);
    }

  unget_char (lvalp, llocp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number.  Skips all   |
| blanks and tabs, returns 0 for EOF.                            |
`---------------------------------------------------------------*/

int
yylex (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  static int init = 1;
  int c;

  if (init)
    {
      init = 0;

      (*llocp).last_column = 1;
      (*llocp).last_line = 1;

    }


 (*llocp).first_column = (*llocp).last_column;
  (*llocp).first_line   = (*llocp).last_line;


  /* Skip white space.  */
  while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t')
    {
     (*llocp).first_column = (*llocp).last_column;
      (*llocp).first_line   = (*llocp).last_line;

    }

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp, llocp,  c);
      (*lvalp).ival = read_signed_integer (lvalp, llocp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}
_ATEOF





if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/calc.at:635: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.cc calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:635"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:635"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:635: bison --xml=xml-tests/test.xml -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:635"
( $at_check_trace; bison --xml=xml-tests/test.xml -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:635"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:635: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:635"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:635"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/calc.at:635: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:635"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:635"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/calc.at:635: bison -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:635"
( $at_check_trace; bison -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:635"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/calc.at:635: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:635"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:635"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:635: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc $LIBS" "calc.at:635"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:635"
$at_failed && at_fn_log_failure
$at_traceon; }



# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:635:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:635"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:635"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:635:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:635"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:635"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:635: cat stderr"
at_fn_check_prepare_trace "calc.at:635"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:635"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:635:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:635"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:635"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:635: cat stderr"
at_fn_check_prepare_trace "calc.at:635"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:635"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:635:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:635"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:635"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:635: cat stderr"
at_fn_check_prepare_trace "calc.at:635"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:635"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:635:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:635"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:635"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:635: cat stderr"
at_fn_check_prepare_trace "calc.at:635"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:635"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:635:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:635"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:635"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:635: cat stderr"
at_fn_check_prepare_trace "calc.at:635"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:635"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:635:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:635"
( $at_check_trace;  $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:635"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:635: cat stderr"
at_fn_check_prepare_trace "calc.at:635"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:635"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:635:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:635"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:635"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:635: cat stderr"
at_fn_check_prepare_trace "calc.at:635"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:635"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:635:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:635"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:635"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:635: cat stderr"
at_fn_check_prepare_trace "calc.at:635"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:635"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:635:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:635"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:635"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:635: cat stderr"
at_fn_check_prepare_trace "calc.at:635"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:635"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check that yyerrok works properly: second error is not reported,
# third and fourth are.  Parse status is succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:635:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:635"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:635"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:635: cat stderr"
at_fn_check_prepare_trace "calc.at:635"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:635"
$at_failed && at_fn_log_failure
$at_traceon; }



























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_149
#AT_START_150
# 150. calc.at:644: Calculator %language "C++" %defines %locations
at_setup_line='calc.at:644'
at_fn_banner 12
at_desc="Calculator %language \"C++\" %defines %locations "
at_desc_line="150: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "150. calc.at:644: testing ..."
  $at_traceon









# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.














cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%language "C++" %defines %locations
%define global_tokens_and_yystype
%code requires {
/* Exercise pre-prologue dependency to %union.  */
typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};

%code provides {
#include <stdio.h>
/* The input.  */
extern FILE *input;
#ifndef YYLTYPE
# define YYLTYPE yy::location
#endif
#define first_line   begin.line
#define first_column begin.column
#define last_line    end.line
#define last_column  end.column
}

%code {
#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#else
# undef alarm
# define alarm(seconds) /* empty */
#endif
#define USE(Var)

FILE *input;
static semantic_value global_result = 0;
static int global_count = 0;
static int power (int base, int exponent);

int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
}

/* The lalr1.cc skeleton, for backward compatibility, defines
   a constructor for position that initializes the filename.  The
   glr.cc skeleton does not (and in fact cannot: location/position
   are stored in a union, from which objects with constructors are
   excluded in C++. */
%initial-action {
  @$.initialize (0);
}


/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type  <ival> exp

%nonassoc '=' /* comparison	       */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line         {  }
;

line:
  '\n'
| exp '\n'           { USE ($1); }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

/* A C++ error reporting function.  */
void
yy::parser::error (const location& l, const std::string& m)
{
  (void) l;
  std::cerr << l << ": " << m << std::endl;
}

int
yyparse ()
{
  yy::parser parser;
#if YYDEBUG
  parser.set_debug_level (1);
#endif
  return parser.parse ();
}




static int
power (int base, int exponent)
{
  int res = 1;
  if (exponent < 0)
    exit (3);
  for (/* Niente */; exponent; --exponent)
    res *= base;
  return res;
}


int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* This used to be alarm (10), but that isn't enough time for
     a July 1995 vintage DEC Alphastation 200 4/100 system,
     according to Nelson H. F. Beebe.  100 seconds is enough.  */
  alarm (100);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  fclose (input);
  if (global_result != result)
    abort ();
  if (global_count != count)
    abort ();
  return status;
}
_ATEOF


cat >calc-lex.cc <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.hh"

#include <ctype.h>

int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp);
static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c);


static YYLTYPE last_yylloc;

static int
get_char (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int res = getc (input);
  (void) lvalp;(void) llocp;

  last_yylloc = (*llocp);
  if (res == '\n')
    {
      (*llocp).last_line++;
      (*llocp).last_column = 1;
    }
  else
    (*llocp).last_column++;

  return res;
}

static void
unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c)
{
  (void) lvalp;(void) llocp;

  /* Wrong when C == `\n'. */
  (*llocp) = last_yylloc;

  ungetc (c, input);
}

static int
read_signed_integer (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int c = get_char (lvalp, llocp);
  int sign = 1;
  int n = 0;

  (void) lvalp;(void) llocp;
  if (c == '-')
    {
      c = get_char (lvalp, llocp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp, llocp);
    }

  unget_char (lvalp, llocp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number.  Skips all   |
| blanks and tabs, returns 0 for EOF.                            |
`---------------------------------------------------------------*/

int
yylex (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  static int init = 1;
  int c;

  if (init)
    {
      init = 0;

      (*llocp).last_column = 1;
      (*llocp).last_line = 1;

    }


 (*llocp).first_column = (*llocp).last_column;
  (*llocp).first_line   = (*llocp).last_line;


  /* Skip white space.  */
  while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t')
    {
     (*llocp).first_column = (*llocp).last_column;
      (*llocp).first_line   = (*llocp).last_line;

    }

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp, llocp,  c);
      (*lvalp).ival = read_signed_integer (lvalp, llocp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}
_ATEOF





if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/calc.at:644: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.cc calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:644"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:644: bison --xml=xml-tests/test.xml -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:644"
( $at_check_trace; bison --xml=xml-tests/test.xml -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:644: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:644"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/calc.at:644: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:644"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/calc.at:644: bison -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:644"
( $at_check_trace; bison -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/calc.at:644: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:644"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:644: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc $LIBS" "calc.at:644"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }



# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:644:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:644:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:644: cat stderr"
at_fn_check_prepare_trace "calc.at:644"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:644:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:644: cat stderr"
at_fn_check_prepare_trace "calc.at:644"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:644:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:644: cat stderr"
at_fn_check_prepare_trace "calc.at:644"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:644:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:644: cat stderr"
at_fn_check_prepare_trace "calc.at:644"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:644:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:644: cat stderr"
at_fn_check_prepare_trace "calc.at:644"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:644:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:644"
( $at_check_trace;  $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:644: cat stderr"
at_fn_check_prepare_trace "calc.at:644"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:644:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:644: cat stderr"
at_fn_check_prepare_trace "calc.at:644"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:644:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:644: cat stderr"
at_fn_check_prepare_trace "calc.at:644"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:644:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:644: cat stderr"
at_fn_check_prepare_trace "calc.at:644"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check that yyerrok works properly: second error is not reported,
# third and fourth are.  Parse status is succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:644:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:644"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:644: cat stderr"
at_fn_check_prepare_trace "calc.at:644"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }



























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_150
#AT_START_151
# 151. calc.at:645: Calculator %language "C++" %defines %locations %error-verbose %name-prefix "calc" %verbose %yacc
at_setup_line='calc.at:645'
at_fn_banner 12
at_desc="Calculator %language \"C++\" %defines %locations %error-verbose %name-prefix \"calc\" %verbose %yacc"
at_desc_line="151: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "151. calc.at:645: testing ..."
  $at_traceon









# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.














cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%language "C++" %defines %locations %error-verbose %name-prefix "calc" %verbose %yacc
%define global_tokens_and_yystype
%code requires {
/* Exercise pre-prologue dependency to %union.  */
typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};

%code provides {
#include <stdio.h>
/* The input.  */
extern FILE *input;
#ifndef YYLTYPE
# define YYLTYPE calc::location
#endif
#define first_line   begin.line
#define first_column begin.column
#define last_line    end.line
#define last_column  end.column
}

%code {
#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#else
# undef alarm
# define alarm(seconds) /* empty */
#endif
#define USE(Var)

FILE *input;
static semantic_value global_result = 0;
static int global_count = 0;
static int power (int base, int exponent);

int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
}

/* The lalr1.cc skeleton, for backward compatibility, defines
   a constructor for position that initializes the filename.  The
   glr.cc skeleton does not (and in fact cannot: location/position
   are stored in a union, from which objects with constructors are
   excluded in C++. */
%initial-action {
  @$.initialize (0);
}


/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type  <ival> exp

%nonassoc '=' /* comparison	       */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line         {  }
;

line:
  '\n'
| exp '\n'           { USE ($1); }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

/* A C++ error reporting function.  */
void
calc::parser::error (const location& l, const std::string& m)
{
  (void) l;
  std::cerr << l << ": " << m << std::endl;
}

int
yyparse ()
{
  calc::parser parser;
#if YYDEBUG
  parser.set_debug_level (1);
#endif
  return parser.parse ();
}




static int
power (int base, int exponent)
{
  int res = 1;
  if (exponent < 0)
    exit (3);
  for (/* Niente */; exponent; --exponent)
    res *= base;
  return res;
}


int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* This used to be alarm (10), but that isn't enough time for
     a July 1995 vintage DEC Alphastation 200 4/100 system,
     according to Nelson H. F. Beebe.  100 seconds is enough.  */
  alarm (100);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  fclose (input);
  if (global_result != result)
    abort ();
  if (global_count != count)
    abort ();
  return status;
}
_ATEOF


cat >calc-lex.cc <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.hh"

#include <ctype.h>

int calclex (YYSTYPE *lvalp, YYLTYPE *llocp);
static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp);
static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c);


static YYLTYPE last_yylloc;

static int
get_char (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int res = getc (input);
  (void) lvalp;(void) llocp;

  last_yylloc = (*llocp);
  if (res == '\n')
    {
      (*llocp).last_line++;
      (*llocp).last_column = 1;
    }
  else
    (*llocp).last_column++;

  return res;
}

static void
unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c)
{
  (void) lvalp;(void) llocp;

  /* Wrong when C == `\n'. */
  (*llocp) = last_yylloc;

  ungetc (c, input);
}

static int
read_signed_integer (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int c = get_char (lvalp, llocp);
  int sign = 1;
  int n = 0;

  (void) lvalp;(void) llocp;
  if (c == '-')
    {
      c = get_char (lvalp, llocp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp, llocp);
    }

  unget_char (lvalp, llocp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number.  Skips all   |
| blanks and tabs, returns 0 for EOF.                            |
`---------------------------------------------------------------*/

int
calclex (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  static int init = 1;
  int c;

  if (init)
    {
      init = 0;

      (*llocp).last_column = 1;
      (*llocp).last_line = 1;

    }


 (*llocp).first_column = (*llocp).last_column;
  (*llocp).first_line   = (*llocp).last_line;


  /* Skip white space.  */
  while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t')
    {
     (*llocp).first_column = (*llocp).last_column;
      (*llocp).first_line   = (*llocp).last_line;

    }

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp, llocp,  c);
      (*lvalp).ival = read_signed_integer (lvalp, llocp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}
_ATEOF





if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/calc.at:645: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.cc calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:645"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:645: bison --xml=xml-tests/test.xml -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:645"
( $at_check_trace; bison --xml=xml-tests/test.xml -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:645: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:645"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/calc.at:645: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:645"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/calc.at:645: bison -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:645"
( $at_check_trace; bison -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/calc.at:645: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:645"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:645: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc $LIBS" "calc.at:645"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }



# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:645:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:645:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:645: cat stderr"
at_fn_check_prepare_trace "calc.at:645"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:645:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:645: cat stderr"
at_fn_check_prepare_trace "calc.at:645"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:645:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:645: cat stderr"
at_fn_check_prepare_trace "calc.at:645"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:645:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:645: cat stderr"
at_fn_check_prepare_trace "calc.at:645"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:645:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:645: cat stderr"
at_fn_check_prepare_trace "calc.at:645"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:645:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:645"
( $at_check_trace;  $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:645: cat stderr"
at_fn_check_prepare_trace "calc.at:645"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:645:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:645: cat stderr"
at_fn_check_prepare_trace "calc.at:645"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:645:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:645: cat stderr"
at_fn_check_prepare_trace "calc.at:645"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:645:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:645: cat stderr"
at_fn_check_prepare_trace "calc.at:645"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check that yyerrok works properly: second error is not reported,
# third and fourth are.  Parse status is succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:645:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:645"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:645: cat stderr"
at_fn_check_prepare_trace "calc.at:645"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }



























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_151
#AT_START_152
# 152. calc.at:647: Calculator %language "C++" %defines %locations %error-verbose %debug %name-prefix "calc" %verbose %yacc
at_setup_line='calc.at:647'
at_fn_banner 12
at_desc="Calculator %language \"C++\" %defines %locations %error-verbose %debug %name-prefix \"calc\" %verbose %yacc"
at_desc_line="152: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "152. calc.at:647: testing ..."
  $at_traceon









# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.














cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%language "C++" %defines %locations %error-verbose %debug %name-prefix "calc" %verbose %yacc
%define global_tokens_and_yystype
%code requires {
/* Exercise pre-prologue dependency to %union.  */
typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};

%code provides {
#include <stdio.h>
/* The input.  */
extern FILE *input;
#ifndef YYLTYPE
# define YYLTYPE calc::location
#endif
#define first_line   begin.line
#define first_column begin.column
#define last_line    end.line
#define last_column  end.column
}

%code {
#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#else
# undef alarm
# define alarm(seconds) /* empty */
#endif
#define USE(Var)

FILE *input;
static semantic_value global_result = 0;
static int global_count = 0;
static int power (int base, int exponent);

int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
}

/* The lalr1.cc skeleton, for backward compatibility, defines
   a constructor for position that initializes the filename.  The
   glr.cc skeleton does not (and in fact cannot: location/position
   are stored in a union, from which objects with constructors are
   excluded in C++. */
%initial-action {
  @$.initialize (0);
}


/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type  <ival> exp

%nonassoc '=' /* comparison	       */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line         {  }
;

line:
  '\n'
| exp '\n'           { USE ($1); }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

/* A C++ error reporting function.  */
void
calc::parser::error (const location& l, const std::string& m)
{
  (void) l;
  std::cerr << l << ": " << m << std::endl;
}

int
yyparse ()
{
  calc::parser parser;
#if YYDEBUG
  parser.set_debug_level (1);
#endif
  return parser.parse ();
}




static int
power (int base, int exponent)
{
  int res = 1;
  if (exponent < 0)
    exit (3);
  for (/* Niente */; exponent; --exponent)
    res *= base;
  return res;
}


int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* This used to be alarm (10), but that isn't enough time for
     a July 1995 vintage DEC Alphastation 200 4/100 system,
     according to Nelson H. F. Beebe.  100 seconds is enough.  */
  alarm (100);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  fclose (input);
  if (global_result != result)
    abort ();
  if (global_count != count)
    abort ();
  return status;
}
_ATEOF


cat >calc-lex.cc <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.hh"

#include <ctype.h>

int calclex (YYSTYPE *lvalp, YYLTYPE *llocp);
static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp);
static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c);


static YYLTYPE last_yylloc;

static int
get_char (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int res = getc (input);
  (void) lvalp;(void) llocp;

  last_yylloc = (*llocp);
  if (res == '\n')
    {
      (*llocp).last_line++;
      (*llocp).last_column = 1;
    }
  else
    (*llocp).last_column++;

  return res;
}

static void
unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c)
{
  (void) lvalp;(void) llocp;

  /* Wrong when C == `\n'. */
  (*llocp) = last_yylloc;

  ungetc (c, input);
}

static int
read_signed_integer (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int c = get_char (lvalp, llocp);
  int sign = 1;
  int n = 0;

  (void) lvalp;(void) llocp;
  if (c == '-')
    {
      c = get_char (lvalp, llocp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp, llocp);
    }

  unget_char (lvalp, llocp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number.  Skips all   |
| blanks and tabs, returns 0 for EOF.                            |
`---------------------------------------------------------------*/

int
calclex (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  static int init = 1;
  int c;

  if (init)
    {
      init = 0;

      (*llocp).last_column = 1;
      (*llocp).last_line = 1;

    }


 (*llocp).first_column = (*llocp).last_column;
  (*llocp).first_line   = (*llocp).last_line;


  /* Skip white space.  */
  while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t')
    {
     (*llocp).first_column = (*llocp).last_column;
      (*llocp).first_line   = (*llocp).last_line;

    }

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp, llocp,  c);
      (*lvalp).ival = read_signed_integer (lvalp, llocp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}
_ATEOF





if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/calc.at:647: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.cc calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:647"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:647: bison --xml=xml-tests/test.xml -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:647"
( $at_check_trace; bison --xml=xml-tests/test.xml -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:647: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:647"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/calc.at:647: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:647"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/calc.at:647: bison -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:647"
( $at_check_trace; bison -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/calc.at:647: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:647"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:647: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc $LIBS" "calc.at:647"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }



# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:647:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:647"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:647:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:647"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:647: cat stderr"
at_fn_check_prepare_trace "calc.at:647"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:647:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:647"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:647: cat stderr"
at_fn_check_prepare_trace "calc.at:647"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:647:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:647"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:647: cat stderr"
at_fn_check_prepare_trace "calc.at:647"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:647:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:647"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:647: cat stderr"
at_fn_check_prepare_trace "calc.at:647"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:647:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:647"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:647: cat stderr"
at_fn_check_prepare_trace "calc.at:647"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:647:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:647"
( $at_check_trace;  $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:647: cat stderr"
at_fn_check_prepare_trace "calc.at:647"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:647:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:647"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:647: cat stderr"
at_fn_check_prepare_trace "calc.at:647"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:647:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:647"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:647: cat stderr"
at_fn_check_prepare_trace "calc.at:647"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:647:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:647"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:647: cat stderr"
at_fn_check_prepare_trace "calc.at:647"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check that yyerrok works properly: second error is not reported,
# third and fourth are.  Parse status is succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:647:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:647"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:647: cat stderr"
at_fn_check_prepare_trace "calc.at:647"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }



























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_152
#AT_START_153
# 153. calc.at:649: Calculator %language "C++" %defines %locations %pure-parser %error-verbose %debug %name-prefix "calc" %verbose %yacc
at_setup_line='calc.at:649'
at_fn_banner 12
at_desc="Calculator %language \"C++\" %defines %locations %pure-parser %error-verbose %debug %name-prefix \"calc\" %verbose %yacc"
at_desc_line="153: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "153. calc.at:649: testing ..."
  $at_traceon









# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.














cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%language "C++" %defines %locations %pure-parser %error-verbose %debug %name-prefix "calc" %verbose %yacc
%define global_tokens_and_yystype
%code requires {
/* Exercise pre-prologue dependency to %union.  */
typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};

%code provides {
#include <stdio.h>
/* The input.  */
extern FILE *input;
#ifndef YYLTYPE
# define YYLTYPE calc::location
#endif
#define first_line   begin.line
#define first_column begin.column
#define last_line    end.line
#define last_column  end.column
}

%code {
#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#else
# undef alarm
# define alarm(seconds) /* empty */
#endif
#define USE(Var)

FILE *input;
static semantic_value global_result = 0;
static int global_count = 0;
static int power (int base, int exponent);

int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
}

/* The lalr1.cc skeleton, for backward compatibility, defines
   a constructor for position that initializes the filename.  The
   glr.cc skeleton does not (and in fact cannot: location/position
   are stored in a union, from which objects with constructors are
   excluded in C++. */
%initial-action {
  @$.initialize (0);
}


/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type  <ival> exp

%nonassoc '=' /* comparison	       */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line         {  }
;

line:
  '\n'
| exp '\n'           { USE ($1); }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

/* A C++ error reporting function.  */
void
calc::parser::error (const location& l, const std::string& m)
{
  (void) l;
  std::cerr << l << ": " << m << std::endl;
}

int
yyparse ()
{
  calc::parser parser;
#if YYDEBUG
  parser.set_debug_level (1);
#endif
  return parser.parse ();
}




static int
power (int base, int exponent)
{
  int res = 1;
  if (exponent < 0)
    exit (3);
  for (/* Niente */; exponent; --exponent)
    res *= base;
  return res;
}


int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* This used to be alarm (10), but that isn't enough time for
     a July 1995 vintage DEC Alphastation 200 4/100 system,
     according to Nelson H. F. Beebe.  100 seconds is enough.  */
  alarm (100);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  fclose (input);
  if (global_result != result)
    abort ();
  if (global_count != count)
    abort ();
  return status;
}
_ATEOF


cat >calc-lex.cc <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.hh"

#include <ctype.h>

int calclex (YYSTYPE *lvalp, YYLTYPE *llocp);
static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp);
static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c);


static YYLTYPE last_yylloc;

static int
get_char (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int res = getc (input);
  (void) lvalp;(void) llocp;

  last_yylloc = (*llocp);
  if (res == '\n')
    {
      (*llocp).last_line++;
      (*llocp).last_column = 1;
    }
  else
    (*llocp).last_column++;

  return res;
}

static void
unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c)
{
  (void) lvalp;(void) llocp;

  /* Wrong when C == `\n'. */
  (*llocp) = last_yylloc;

  ungetc (c, input);
}

static int
read_signed_integer (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int c = get_char (lvalp, llocp);
  int sign = 1;
  int n = 0;

  (void) lvalp;(void) llocp;
  if (c == '-')
    {
      c = get_char (lvalp, llocp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp, llocp);
    }

  unget_char (lvalp, llocp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number.  Skips all   |
| blanks and tabs, returns 0 for EOF.                            |
`---------------------------------------------------------------*/

int
calclex (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  static int init = 1;
  int c;

  if (init)
    {
      init = 0;

      (*llocp).last_column = 1;
      (*llocp).last_line = 1;

    }


 (*llocp).first_column = (*llocp).last_column;
  (*llocp).first_line   = (*llocp).last_line;


  /* Skip white space.  */
  while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t')
    {
     (*llocp).first_column = (*llocp).last_column;
      (*llocp).first_line   = (*llocp).last_line;

    }

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp, llocp,  c);
      (*lvalp).ival = read_signed_integer (lvalp, llocp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}
_ATEOF





if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/calc.at:649: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.cc calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:649"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:649: bison --xml=xml-tests/test.xml -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:649"
( $at_check_trace; bison --xml=xml-tests/test.xml -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:649: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:649"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/calc.at:649: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:649"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/calc.at:649: bison -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:649"
( $at_check_trace; bison -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/calc.at:649: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:649"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:649: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc $LIBS" "calc.at:649"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
$at_failed && at_fn_log_failure
$at_traceon; }



# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:649:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:649"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:649:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:649"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:649"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:649: cat stderr"
at_fn_check_prepare_trace "calc.at:649"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:649:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:649"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:649"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:649: cat stderr"
at_fn_check_prepare_trace "calc.at:649"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:649:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:649"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:649"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:649: cat stderr"
at_fn_check_prepare_trace "calc.at:649"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:649:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:649"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:649"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:649: cat stderr"
at_fn_check_prepare_trace "calc.at:649"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:649:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:649"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:649"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:649: cat stderr"
at_fn_check_prepare_trace "calc.at:649"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:649:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:649"
( $at_check_trace;  $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:649"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:649: cat stderr"
at_fn_check_prepare_trace "calc.at:649"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:649:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:649"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:649: cat stderr"
at_fn_check_prepare_trace "calc.at:649"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:649:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:649"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:649: cat stderr"
at_fn_check_prepare_trace "calc.at:649"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:649:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:649"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:649: cat stderr"
at_fn_check_prepare_trace "calc.at:649"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check that yyerrok works properly: second error is not reported,
# third and fourth are.  Parse status is succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:649:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:649"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:649: cat stderr"
at_fn_check_prepare_trace "calc.at:649"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:649"
$at_failed && at_fn_log_failure
$at_traceon; }



























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_153
#AT_START_154
# 154. calc.at:651: Calculator %language "C++" %defines %locations %pure-parser %error-verbose %debug %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}
at_setup_line='calc.at:651'
at_fn_banner 12
at_desc="Calculator %language \"C++\" %defines %locations %pure-parser %error-verbose %debug %name-prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}"
at_desc_line="154: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "154. calc.at:651: testing ..."
  $at_traceon









# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.














cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%language "C++" %defines %locations %pure-parser %error-verbose %debug %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}
%define global_tokens_and_yystype
%code requires {
/* Exercise pre-prologue dependency to %union.  */
typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};

%code provides {
#include <stdio.h>
/* The input.  */
extern FILE *input;
#ifndef YYLTYPE
# define YYLTYPE calc::location
#endif
#define first_line   begin.line
#define first_column begin.column
#define last_line    end.line
#define last_column  end.column
}

%code {
#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#else
# undef alarm
# define alarm(seconds) /* empty */
#endif
#define USE(Var)

FILE *input;
static semantic_value global_result = 0;
static int global_count = 0;
static int power (int base, int exponent);

int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
}

/* The lalr1.cc skeleton, for backward compatibility, defines
   a constructor for position that initializes the filename.  The
   glr.cc skeleton does not (and in fact cannot: location/position
   are stored in a union, from which objects with constructors are
   excluded in C++. */
%initial-action {
  @$.initialize (0);
}


/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type  <ival> exp

%nonassoc '=' /* comparison	       */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line         { ++*count; ++global_count; }
;

line:
  '\n'
| exp '\n'           { *result = global_result = $1; }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

/* A C++ error reporting function.  */
void
calc::parser::error (const location& l, const std::string& m)
{
  (void) l;
  std::cerr << l << ": " << m << std::endl;
}

int
yyparse (semantic_value *result, int *count)
{
  calc::parser parser (result, count);
#if YYDEBUG
  parser.set_debug_level (1);
#endif
  return parser.parse ();
}




static int
power (int base, int exponent)
{
  int res = 1;
  if (exponent < 0)
    exit (3);
  for (/* Niente */; exponent; --exponent)
    res *= base;
  return res;
}


int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* This used to be alarm (10), but that isn't enough time for
     a July 1995 vintage DEC Alphastation 200 4/100 system,
     according to Nelson H. F. Beebe.  100 seconds is enough.  */
  alarm (100);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse (&result, &count);
  fclose (input);
  if (global_result != result)
    abort ();
  if (global_count != count)
    abort ();
  return status;
}
_ATEOF


cat >calc-lex.cc <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.hh"

#include <ctype.h>

int calclex (YYSTYPE *lvalp, YYLTYPE *llocp);
static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp);
static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c);


static YYLTYPE last_yylloc;

static int
get_char (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int res = getc (input);
  (void) lvalp;(void) llocp;

  last_yylloc = (*llocp);
  if (res == '\n')
    {
      (*llocp).last_line++;
      (*llocp).last_column = 1;
    }
  else
    (*llocp).last_column++;

  return res;
}

static void
unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c)
{
  (void) lvalp;(void) llocp;

  /* Wrong when C == `\n'. */
  (*llocp) = last_yylloc;

  ungetc (c, input);
}

static int
read_signed_integer (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int c = get_char (lvalp, llocp);
  int sign = 1;
  int n = 0;

  (void) lvalp;(void) llocp;
  if (c == '-')
    {
      c = get_char (lvalp, llocp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp, llocp);
    }

  unget_char (lvalp, llocp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number.  Skips all   |
| blanks and tabs, returns 0 for EOF.                            |
`---------------------------------------------------------------*/

int
calclex (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  static int init = 1;
  int c;

  if (init)
    {
      init = 0;

      (*llocp).last_column = 1;
      (*llocp).last_line = 1;

    }


 (*llocp).first_column = (*llocp).last_column;
  (*llocp).first_line   = (*llocp).last_line;


  /* Skip white space.  */
  while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t')
    {
     (*llocp).first_column = (*llocp).last_column;
      (*llocp).first_line   = (*llocp).last_line;

    }

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp, llocp,  c);
      (*lvalp).ival = read_signed_integer (lvalp, llocp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}
_ATEOF





if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/calc.at:651: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.cc calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:651"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:651: bison --xml=xml-tests/test.xml -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:651"
( $at_check_trace; bison --xml=xml-tests/test.xml -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:651: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:651"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/calc.at:651: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:651"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/calc.at:651: bison -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:651"
( $at_check_trace; bison -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/calc.at:651: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:651"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:651: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc $LIBS" "calc.at:651"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
$at_failed && at_fn_log_failure
$at_traceon; }



# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:651:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:651"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:651:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:651"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:651"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:651: cat stderr"
at_fn_check_prepare_trace "calc.at:651"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:651:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:651"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:651"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:651: cat stderr"
at_fn_check_prepare_trace "calc.at:651"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:651:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:651"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:651"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:651: cat stderr"
at_fn_check_prepare_trace "calc.at:651"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:651:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:651"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:651"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:651: cat stderr"
at_fn_check_prepare_trace "calc.at:651"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:651:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:651"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:651"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:651: cat stderr"
at_fn_check_prepare_trace "calc.at:651"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:651:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:651"
( $at_check_trace;  $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:651"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:651: cat stderr"
at_fn_check_prepare_trace "calc.at:651"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:651:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:651"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:651: cat stderr"
at_fn_check_prepare_trace "calc.at:651"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:651:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:651"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:651: cat stderr"
at_fn_check_prepare_trace "calc.at:651"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:651:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:651"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:651: cat stderr"
at_fn_check_prepare_trace "calc.at:651"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check that yyerrok works properly: second error is not reported,
# third and fourth are.  Parse status is succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:651:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:651"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:651: cat stderr"
at_fn_check_prepare_trace "calc.at:651"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:651"
$at_failed && at_fn_log_failure
$at_traceon; }



























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_154
#AT_START_155
# 155. calc.at:662: Calculator %skeleton "glr.cc" %defines %locations
at_setup_line='calc.at:662'
at_fn_banner 13
at_desc="Calculator %skeleton \"glr.cc\" %defines %locations"
at_desc_line="155: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "155. calc.at:662: testing ..."
  $at_traceon









# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.














cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%skeleton "glr.cc" %defines %locations
%define global_tokens_and_yystype
%code requires {
/* Exercise pre-prologue dependency to %union.  */
typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};

%code provides {
#include <stdio.h>
/* The input.  */
extern FILE *input;
#ifndef YYLTYPE
# define YYLTYPE yy::location
#endif
#define first_line   begin.line
#define first_column begin.column
#define last_line    end.line
#define last_column  end.column
}

%code {
#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#else
# undef alarm
# define alarm(seconds) /* empty */
#endif
#define USE(Var)

FILE *input;
static semantic_value global_result = 0;
static int global_count = 0;
static int power (int base, int exponent);

int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
}

/* The lalr1.cc skeleton, for backward compatibility, defines
   a constructor for position that initializes the filename.  The
   glr.cc skeleton does not (and in fact cannot: location/position
   are stored in a union, from which objects with constructors are
   excluded in C++. */
%initial-action {
  @$.initialize (0);
}


/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type  <ival> exp

%nonassoc '=' /* comparison	       */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line         {  }
;

line:
  '\n'
| exp '\n'           { USE ($1); }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

/* A C++ error reporting function.  */
void
yy::parser::error (const location& l, const std::string& m)
{
  (void) l;
  std::cerr << l << ": " << m << std::endl;
}

int
yyparse ()
{
  yy::parser parser;
#if YYDEBUG
  parser.set_debug_level (1);
#endif
  return parser.parse ();
}




static int
power (int base, int exponent)
{
  int res = 1;
  if (exponent < 0)
    exit (3);
  for (/* Niente */; exponent; --exponent)
    res *= base;
  return res;
}


int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* This used to be alarm (10), but that isn't enough time for
     a July 1995 vintage DEC Alphastation 200 4/100 system,
     according to Nelson H. F. Beebe.  100 seconds is enough.  */
  alarm (100);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  fclose (input);
  if (global_result != result)
    abort ();
  if (global_count != count)
    abort ();
  return status;
}
_ATEOF


cat >calc-lex.cc <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.hh"

#include <ctype.h>

int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp);
static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c);


static YYLTYPE last_yylloc;

static int
get_char (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int res = getc (input);
  (void) lvalp;(void) llocp;

  last_yylloc = (*llocp);
  if (res == '\n')
    {
      (*llocp).last_line++;
      (*llocp).last_column = 1;
    }
  else
    (*llocp).last_column++;

  return res;
}

static void
unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c)
{
  (void) lvalp;(void) llocp;

  /* Wrong when C == `\n'. */
  (*llocp) = last_yylloc;

  ungetc (c, input);
}

static int
read_signed_integer (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int c = get_char (lvalp, llocp);
  int sign = 1;
  int n = 0;

  (void) lvalp;(void) llocp;
  if (c == '-')
    {
      c = get_char (lvalp, llocp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp, llocp);
    }

  unget_char (lvalp, llocp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number.  Skips all   |
| blanks and tabs, returns 0 for EOF.                            |
`---------------------------------------------------------------*/

int
yylex (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  static int init = 1;
  int c;

  if (init)
    {
      init = 0;

      (*llocp).last_column = 1;
      (*llocp).last_line = 1;

    }


 (*llocp).first_column = (*llocp).last_column;
  (*llocp).first_line   = (*llocp).last_line;


  /* Skip white space.  */
  while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t')
    {
     (*llocp).first_column = (*llocp).last_column;
      (*llocp).first_line   = (*llocp).last_line;

    }

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp, llocp,  c);
      (*lvalp).ival = read_signed_integer (lvalp, llocp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}
_ATEOF





if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/calc.at:662: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.cc calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:662"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:662"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:662: bison --xml=xml-tests/test.xml -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:662"
( $at_check_trace; bison --xml=xml-tests/test.xml -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:662"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:662: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:662"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:662"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/calc.at:662: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:662"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:662"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/calc.at:662: bison -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:662"
( $at_check_trace; bison -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:662"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/calc.at:662: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:662"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:662"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:662: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc $LIBS" "calc.at:662"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:662"
$at_failed && at_fn_log_failure
$at_traceon; }



# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:662:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:662"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:662"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:662:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:662"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:662"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:662: cat stderr"
at_fn_check_prepare_trace "calc.at:662"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:662"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:662:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:662"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:662"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:662: cat stderr"
at_fn_check_prepare_trace "calc.at:662"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:662"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:662:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:662"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:662"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:662: cat stderr"
at_fn_check_prepare_trace "calc.at:662"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:662"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:662:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:662"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:662"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:662: cat stderr"
at_fn_check_prepare_trace "calc.at:662"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:662"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:662:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:662"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:662"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:662: cat stderr"
at_fn_check_prepare_trace "calc.at:662"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:662"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:662:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:662"
( $at_check_trace;  $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:662"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:662: cat stderr"
at_fn_check_prepare_trace "calc.at:662"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:662"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:662:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:662"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:662"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:662: cat stderr"
at_fn_check_prepare_trace "calc.at:662"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:662"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:662:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:662"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:662"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:662: cat stderr"
at_fn_check_prepare_trace "calc.at:662"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:662"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:662:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:662"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:662"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:662: cat stderr"
at_fn_check_prepare_trace "calc.at:662"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:662"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check that yyerrok works properly: second error is not reported,
# third and fourth are.  Parse status is succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:662:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:662"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:662"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:662: cat stderr"
at_fn_check_prepare_trace "calc.at:662"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:662"
$at_failed && at_fn_log_failure
$at_traceon; }



























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_155
#AT_START_156
# 156. calc.at:671: Calculator %language "C++" %glr-parser %defines %locations
at_setup_line='calc.at:671'
at_fn_banner 13
at_desc="Calculator %language \"C++\" %glr-parser %defines %locations "
at_desc_line="156: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "156. calc.at:671: testing ..."
  $at_traceon









# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.














cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%language "C++" %glr-parser %defines %locations
%define global_tokens_and_yystype
%code requires {
/* Exercise pre-prologue dependency to %union.  */
typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};

%code provides {
#include <stdio.h>
/* The input.  */
extern FILE *input;
#ifndef YYLTYPE
# define YYLTYPE yy::location
#endif
#define first_line   begin.line
#define first_column begin.column
#define last_line    end.line
#define last_column  end.column
}

%code {
#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#else
# undef alarm
# define alarm(seconds) /* empty */
#endif
#define USE(Var)

FILE *input;
static semantic_value global_result = 0;
static int global_count = 0;
static int power (int base, int exponent);

int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
}

/* The lalr1.cc skeleton, for backward compatibility, defines
   a constructor for position that initializes the filename.  The
   glr.cc skeleton does not (and in fact cannot: location/position
   are stored in a union, from which objects with constructors are
   excluded in C++. */
%initial-action {
  @$.initialize (0);
}


/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type  <ival> exp

%nonassoc '=' /* comparison	       */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line         {  }
;

line:
  '\n'
| exp '\n'           { USE ($1); }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

/* A C++ error reporting function.  */
void
yy::parser::error (const location& l, const std::string& m)
{
  (void) l;
  std::cerr << l << ": " << m << std::endl;
}

int
yyparse ()
{
  yy::parser parser;
#if YYDEBUG
  parser.set_debug_level (1);
#endif
  return parser.parse ();
}




static int
power (int base, int exponent)
{
  int res = 1;
  if (exponent < 0)
    exit (3);
  for (/* Niente */; exponent; --exponent)
    res *= base;
  return res;
}


int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* This used to be alarm (10), but that isn't enough time for
     a July 1995 vintage DEC Alphastation 200 4/100 system,
     according to Nelson H. F. Beebe.  100 seconds is enough.  */
  alarm (100);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  fclose (input);
  if (global_result != result)
    abort ();
  if (global_count != count)
    abort ();
  return status;
}
_ATEOF


cat >calc-lex.cc <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.hh"

#include <ctype.h>

int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp);
static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c);


static YYLTYPE last_yylloc;

static int
get_char (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int res = getc (input);
  (void) lvalp;(void) llocp;

  last_yylloc = (*llocp);
  if (res == '\n')
    {
      (*llocp).last_line++;
      (*llocp).last_column = 1;
    }
  else
    (*llocp).last_column++;

  return res;
}

static void
unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c)
{
  (void) lvalp;(void) llocp;

  /* Wrong when C == `\n'. */
  (*llocp) = last_yylloc;

  ungetc (c, input);
}

static int
read_signed_integer (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int c = get_char (lvalp, llocp);
  int sign = 1;
  int n = 0;

  (void) lvalp;(void) llocp;
  if (c == '-')
    {
      c = get_char (lvalp, llocp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp, llocp);
    }

  unget_char (lvalp, llocp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number.  Skips all   |
| blanks and tabs, returns 0 for EOF.                            |
`---------------------------------------------------------------*/

int
yylex (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  static int init = 1;
  int c;

  if (init)
    {
      init = 0;

      (*llocp).last_column = 1;
      (*llocp).last_line = 1;

    }


 (*llocp).first_column = (*llocp).last_column;
  (*llocp).first_line   = (*llocp).last_line;


  /* Skip white space.  */
  while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t')
    {
     (*llocp).first_column = (*llocp).last_column;
      (*llocp).first_line   = (*llocp).last_line;

    }

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp, llocp,  c);
      (*lvalp).ival = read_signed_integer (lvalp, llocp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}
_ATEOF





if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/calc.at:671: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.cc calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:671"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:671"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:671: bison --xml=xml-tests/test.xml -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:671"
( $at_check_trace; bison --xml=xml-tests/test.xml -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:671"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:671: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:671"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:671"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/calc.at:671: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:671"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:671"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/calc.at:671: bison -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:671"
( $at_check_trace; bison -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:671"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/calc.at:671: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:671"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:671"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:671: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc $LIBS" "calc.at:671"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:671"
$at_failed && at_fn_log_failure
$at_traceon; }



# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:671:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:671"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:671"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:671:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:671"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:671"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:671: cat stderr"
at_fn_check_prepare_trace "calc.at:671"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:671"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:671:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:671"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:671"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:671: cat stderr"
at_fn_check_prepare_trace "calc.at:671"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:671"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:671:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:671"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:671"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:671: cat stderr"
at_fn_check_prepare_trace "calc.at:671"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:671"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:671:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:671"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:671"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:671: cat stderr"
at_fn_check_prepare_trace "calc.at:671"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:671"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:671:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:671"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:671"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:671: cat stderr"
at_fn_check_prepare_trace "calc.at:671"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:671"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:671:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:671"
( $at_check_trace;  $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:671"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:671: cat stderr"
at_fn_check_prepare_trace "calc.at:671"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:671"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:671:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:671"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:671"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:671: cat stderr"
at_fn_check_prepare_trace "calc.at:671"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:671"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:671:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:671"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:671"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:671: cat stderr"
at_fn_check_prepare_trace "calc.at:671"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:671"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:671:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:671"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:671"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:671: cat stderr"
at_fn_check_prepare_trace "calc.at:671"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:671"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check that yyerrok works properly: second error is not reported,
# third and fourth are.  Parse status is succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:671:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:671"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:671"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:671: cat stderr"
at_fn_check_prepare_trace "calc.at:671"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:671"
$at_failed && at_fn_log_failure
$at_traceon; }



























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_156
#AT_START_157
# 157. calc.at:672: Calculator %language "C++" %glr-parser %defines %locations %error-verbose %name-prefix "calc" %verbose %yacc
at_setup_line='calc.at:672'
at_fn_banner 13
at_desc="Calculator %language \"C++\" %glr-parser %defines %locations %error-verbose %name-prefix \"calc\" %verbose %yacc"
at_desc_line="157: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "157. calc.at:672: testing ..."
  $at_traceon









# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.














cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%language "C++" %glr-parser %defines %locations %error-verbose %name-prefix "calc" %verbose %yacc
%define global_tokens_and_yystype
%code requires {
/* Exercise pre-prologue dependency to %union.  */
typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};

%code provides {
#include <stdio.h>
/* The input.  */
extern FILE *input;
#ifndef YYLTYPE
# define YYLTYPE calc::location
#endif
#define first_line   begin.line
#define first_column begin.column
#define last_line    end.line
#define last_column  end.column
}

%code {
#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#else
# undef alarm
# define alarm(seconds) /* empty */
#endif
#define USE(Var)

FILE *input;
static semantic_value global_result = 0;
static int global_count = 0;
static int power (int base, int exponent);

int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
}

/* The lalr1.cc skeleton, for backward compatibility, defines
   a constructor for position that initializes the filename.  The
   glr.cc skeleton does not (and in fact cannot: location/position
   are stored in a union, from which objects with constructors are
   excluded in C++. */
%initial-action {
  @$.initialize (0);
}


/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type  <ival> exp

%nonassoc '=' /* comparison	       */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line         {  }
;

line:
  '\n'
| exp '\n'           { USE ($1); }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

/* A C++ error reporting function.  */
void
calc::parser::error (const location& l, const std::string& m)
{
  (void) l;
  std::cerr << l << ": " << m << std::endl;
}

int
yyparse ()
{
  calc::parser parser;
#if YYDEBUG
  parser.set_debug_level (1);
#endif
  return parser.parse ();
}




static int
power (int base, int exponent)
{
  int res = 1;
  if (exponent < 0)
    exit (3);
  for (/* Niente */; exponent; --exponent)
    res *= base;
  return res;
}


int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* This used to be alarm (10), but that isn't enough time for
     a July 1995 vintage DEC Alphastation 200 4/100 system,
     according to Nelson H. F. Beebe.  100 seconds is enough.  */
  alarm (100);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  fclose (input);
  if (global_result != result)
    abort ();
  if (global_count != count)
    abort ();
  return status;
}
_ATEOF


cat >calc-lex.cc <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.hh"

#include <ctype.h>

int calclex (YYSTYPE *lvalp, YYLTYPE *llocp);
static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp);
static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c);


static YYLTYPE last_yylloc;

static int
get_char (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int res = getc (input);
  (void) lvalp;(void) llocp;

  last_yylloc = (*llocp);
  if (res == '\n')
    {
      (*llocp).last_line++;
      (*llocp).last_column = 1;
    }
  else
    (*llocp).last_column++;

  return res;
}

static void
unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c)
{
  (void) lvalp;(void) llocp;

  /* Wrong when C == `\n'. */
  (*llocp) = last_yylloc;

  ungetc (c, input);
}

static int
read_signed_integer (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int c = get_char (lvalp, llocp);
  int sign = 1;
  int n = 0;

  (void) lvalp;(void) llocp;
  if (c == '-')
    {
      c = get_char (lvalp, llocp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp, llocp);
    }

  unget_char (lvalp, llocp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number.  Skips all   |
| blanks and tabs, returns 0 for EOF.                            |
`---------------------------------------------------------------*/

int
calclex (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  static int init = 1;
  int c;

  if (init)
    {
      init = 0;

      (*llocp).last_column = 1;
      (*llocp).last_line = 1;

    }


 (*llocp).first_column = (*llocp).last_column;
  (*llocp).first_line   = (*llocp).last_line;


  /* Skip white space.  */
  while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t')
    {
     (*llocp).first_column = (*llocp).last_column;
      (*llocp).first_line   = (*llocp).last_line;

    }

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp, llocp,  c);
      (*lvalp).ival = read_signed_integer (lvalp, llocp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}
_ATEOF





if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/calc.at:672: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.cc calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:672"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:672"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:672: bison --xml=xml-tests/test.xml -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:672"
( $at_check_trace; bison --xml=xml-tests/test.xml -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:672"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:672: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:672"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:672"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/calc.at:672: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:672"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:672"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/calc.at:672: bison -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:672"
( $at_check_trace; bison -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:672"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/calc.at:672: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:672"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:672"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:672: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc $LIBS" "calc.at:672"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:672"
$at_failed && at_fn_log_failure
$at_traceon; }



# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:672:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:672"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:672"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:672:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:672"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:672"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:672: cat stderr"
at_fn_check_prepare_trace "calc.at:672"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:672"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:672:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:672"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:672"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:672: cat stderr"
at_fn_check_prepare_trace "calc.at:672"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:672"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:672:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:672"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:672"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:672: cat stderr"
at_fn_check_prepare_trace "calc.at:672"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:672"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:672:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:672"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:672"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:672: cat stderr"
at_fn_check_prepare_trace "calc.at:672"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:672"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:672:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:672"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:672"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:672: cat stderr"
at_fn_check_prepare_trace "calc.at:672"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:672"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:672:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:672"
( $at_check_trace;  $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:672"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:672: cat stderr"
at_fn_check_prepare_trace "calc.at:672"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:672"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:672:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:672"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:672"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:672: cat stderr"
at_fn_check_prepare_trace "calc.at:672"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:672"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:672:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:672"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:672"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:672: cat stderr"
at_fn_check_prepare_trace "calc.at:672"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:672"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:672:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:672"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:672"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:672: cat stderr"
at_fn_check_prepare_trace "calc.at:672"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:672"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check that yyerrok works properly: second error is not reported,
# third and fourth are.  Parse status is succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:672:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:672"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:672"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:672: cat stderr"
at_fn_check_prepare_trace "calc.at:672"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:672"
$at_failed && at_fn_log_failure
$at_traceon; }



























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_157
#AT_START_158
# 158. calc.at:674: Calculator %language "C++" %glr-parser %defines %locations %debug
at_setup_line='calc.at:674'
at_fn_banner 13
at_desc="Calculator %language \"C++\" %glr-parser %defines %locations %debug"
at_desc_line="158: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "158. calc.at:674: testing ..."
  $at_traceon









# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.














cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%language "C++" %glr-parser %defines %locations %debug
%define global_tokens_and_yystype
%code requires {
/* Exercise pre-prologue dependency to %union.  */
typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};

%code provides {
#include <stdio.h>
/* The input.  */
extern FILE *input;
#ifndef YYLTYPE
# define YYLTYPE yy::location
#endif
#define first_line   begin.line
#define first_column begin.column
#define last_line    end.line
#define last_column  end.column
}

%code {
#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#else
# undef alarm
# define alarm(seconds) /* empty */
#endif
#define USE(Var)

FILE *input;
static semantic_value global_result = 0;
static int global_count = 0;
static int power (int base, int exponent);

int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
}

/* The lalr1.cc skeleton, for backward compatibility, defines
   a constructor for position that initializes the filename.  The
   glr.cc skeleton does not (and in fact cannot: location/position
   are stored in a union, from which objects with constructors are
   excluded in C++. */
%initial-action {
  @$.initialize (0);
}


/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type  <ival> exp

%nonassoc '=' /* comparison	       */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line         {  }
;

line:
  '\n'
| exp '\n'           { USE ($1); }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

/* A C++ error reporting function.  */
void
yy::parser::error (const location& l, const std::string& m)
{
  (void) l;
  std::cerr << l << ": " << m << std::endl;
}

int
yyparse ()
{
  yy::parser parser;
#if YYDEBUG
  parser.set_debug_level (1);
#endif
  return parser.parse ();
}




static int
power (int base, int exponent)
{
  int res = 1;
  if (exponent < 0)
    exit (3);
  for (/* Niente */; exponent; --exponent)
    res *= base;
  return res;
}


int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* This used to be alarm (10), but that isn't enough time for
     a July 1995 vintage DEC Alphastation 200 4/100 system,
     according to Nelson H. F. Beebe.  100 seconds is enough.  */
  alarm (100);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  fclose (input);
  if (global_result != result)
    abort ();
  if (global_count != count)
    abort ();
  return status;
}
_ATEOF


cat >calc-lex.cc <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.hh"

#include <ctype.h>

int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp);
static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c);


static YYLTYPE last_yylloc;

static int
get_char (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int res = getc (input);
  (void) lvalp;(void) llocp;

  last_yylloc = (*llocp);
  if (res == '\n')
    {
      (*llocp).last_line++;
      (*llocp).last_column = 1;
    }
  else
    (*llocp).last_column++;

  return res;
}

static void
unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c)
{
  (void) lvalp;(void) llocp;

  /* Wrong when C == `\n'. */
  (*llocp) = last_yylloc;

  ungetc (c, input);
}

static int
read_signed_integer (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int c = get_char (lvalp, llocp);
  int sign = 1;
  int n = 0;

  (void) lvalp;(void) llocp;
  if (c == '-')
    {
      c = get_char (lvalp, llocp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp, llocp);
    }

  unget_char (lvalp, llocp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number.  Skips all   |
| blanks and tabs, returns 0 for EOF.                            |
`---------------------------------------------------------------*/

int
yylex (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  static int init = 1;
  int c;

  if (init)
    {
      init = 0;

      (*llocp).last_column = 1;
      (*llocp).last_line = 1;

    }


 (*llocp).first_column = (*llocp).last_column;
  (*llocp).first_line   = (*llocp).last_line;


  /* Skip white space.  */
  while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t')
    {
     (*llocp).first_column = (*llocp).last_column;
      (*llocp).first_line   = (*llocp).last_line;

    }

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp, llocp,  c);
      (*lvalp).ival = read_signed_integer (lvalp, llocp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}
_ATEOF





if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/calc.at:674: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.cc calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:674"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:674"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:674: bison --xml=xml-tests/test.xml -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:674"
( $at_check_trace; bison --xml=xml-tests/test.xml -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:674"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:674: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:674"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:674"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/calc.at:674: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:674"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:674"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/calc.at:674: bison -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:674"
( $at_check_trace; bison -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:674"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/calc.at:674: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:674"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:674"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:674: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc $LIBS" "calc.at:674"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:674"
$at_failed && at_fn_log_failure
$at_traceon; }



# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:674:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:674"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:674"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:674:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:674"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:674"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:674: cat stderr"
at_fn_check_prepare_trace "calc.at:674"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:674"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:674:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:674"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:674"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:674: cat stderr"
at_fn_check_prepare_trace "calc.at:674"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:674"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:674:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:674"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:674"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:674: cat stderr"
at_fn_check_prepare_trace "calc.at:674"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:674"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:674:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:674"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:674"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:674: cat stderr"
at_fn_check_prepare_trace "calc.at:674"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:674"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:674:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:674"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:674"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:674: cat stderr"
at_fn_check_prepare_trace "calc.at:674"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:674"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:674:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:674"
( $at_check_trace;  $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:674"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:674: cat stderr"
at_fn_check_prepare_trace "calc.at:674"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:674"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:674:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:674"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:674"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:674: cat stderr"
at_fn_check_prepare_trace "calc.at:674"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:674"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:674:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:674"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:674"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:674: cat stderr"
at_fn_check_prepare_trace "calc.at:674"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:674"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:674:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:674"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:674"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:674: cat stderr"
at_fn_check_prepare_trace "calc.at:674"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:674"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check that yyerrok works properly: second error is not reported,
# third and fourth are.  Parse status is succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:674:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:674"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:674"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:674: cat stderr"
at_fn_check_prepare_trace "calc.at:674"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:674"
$at_failed && at_fn_log_failure
$at_traceon; }



























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_158
#AT_START_159
# 159. calc.at:675: Calculator %language "C++" %glr-parser %defines %locations %error-verbose %debug %name-prefix "calc" %verbose %yacc
at_setup_line='calc.at:675'
at_fn_banner 13
at_desc="Calculator %language \"C++\" %glr-parser %defines %locations %error-verbose %debug %name-prefix \"calc\" %verbose %yacc"
at_desc_line="159: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "159. calc.at:675: testing ..."
  $at_traceon









# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.














cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%language "C++" %glr-parser %defines %locations %error-verbose %debug %name-prefix "calc" %verbose %yacc
%define global_tokens_and_yystype
%code requires {
/* Exercise pre-prologue dependency to %union.  */
typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};

%code provides {
#include <stdio.h>
/* The input.  */
extern FILE *input;
#ifndef YYLTYPE
# define YYLTYPE calc::location
#endif
#define first_line   begin.line
#define first_column begin.column
#define last_line    end.line
#define last_column  end.column
}

%code {
#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#else
# undef alarm
# define alarm(seconds) /* empty */
#endif
#define USE(Var)

FILE *input;
static semantic_value global_result = 0;
static int global_count = 0;
static int power (int base, int exponent);

int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
}

/* The lalr1.cc skeleton, for backward compatibility, defines
   a constructor for position that initializes the filename.  The
   glr.cc skeleton does not (and in fact cannot: location/position
   are stored in a union, from which objects with constructors are
   excluded in C++. */
%initial-action {
  @$.initialize (0);
}


/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type  <ival> exp

%nonassoc '=' /* comparison	       */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line         {  }
;

line:
  '\n'
| exp '\n'           { USE ($1); }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

/* A C++ error reporting function.  */
void
calc::parser::error (const location& l, const std::string& m)
{
  (void) l;
  std::cerr << l << ": " << m << std::endl;
}

int
yyparse ()
{
  calc::parser parser;
#if YYDEBUG
  parser.set_debug_level (1);
#endif
  return parser.parse ();
}




static int
power (int base, int exponent)
{
  int res = 1;
  if (exponent < 0)
    exit (3);
  for (/* Niente */; exponent; --exponent)
    res *= base;
  return res;
}


int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* This used to be alarm (10), but that isn't enough time for
     a July 1995 vintage DEC Alphastation 200 4/100 system,
     according to Nelson H. F. Beebe.  100 seconds is enough.  */
  alarm (100);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  fclose (input);
  if (global_result != result)
    abort ();
  if (global_count != count)
    abort ();
  return status;
}
_ATEOF


cat >calc-lex.cc <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.hh"

#include <ctype.h>

int calclex (YYSTYPE *lvalp, YYLTYPE *llocp);
static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp);
static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c);


static YYLTYPE last_yylloc;

static int
get_char (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int res = getc (input);
  (void) lvalp;(void) llocp;

  last_yylloc = (*llocp);
  if (res == '\n')
    {
      (*llocp).last_line++;
      (*llocp).last_column = 1;
    }
  else
    (*llocp).last_column++;

  return res;
}

static void
unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c)
{
  (void) lvalp;(void) llocp;

  /* Wrong when C == `\n'. */
  (*llocp) = last_yylloc;

  ungetc (c, input);
}

static int
read_signed_integer (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int c = get_char (lvalp, llocp);
  int sign = 1;
  int n = 0;

  (void) lvalp;(void) llocp;
  if (c == '-')
    {
      c = get_char (lvalp, llocp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp, llocp);
    }

  unget_char (lvalp, llocp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number.  Skips all   |
| blanks and tabs, returns 0 for EOF.                            |
`---------------------------------------------------------------*/

int
calclex (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  static int init = 1;
  int c;

  if (init)
    {
      init = 0;

      (*llocp).last_column = 1;
      (*llocp).last_line = 1;

    }


 (*llocp).first_column = (*llocp).last_column;
  (*llocp).first_line   = (*llocp).last_line;


  /* Skip white space.  */
  while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t')
    {
     (*llocp).first_column = (*llocp).last_column;
      (*llocp).first_line   = (*llocp).last_line;

    }

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp, llocp,  c);
      (*lvalp).ival = read_signed_integer (lvalp, llocp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}
_ATEOF





if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/calc.at:675: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.cc calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:675"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:675"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:675: bison --xml=xml-tests/test.xml -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:675"
( $at_check_trace; bison --xml=xml-tests/test.xml -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:675"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:675: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:675"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:675"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/calc.at:675: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:675"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:675"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/calc.at:675: bison -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:675"
( $at_check_trace; bison -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:675"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/calc.at:675: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:675"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:675"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:675: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc $LIBS" "calc.at:675"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:675"
$at_failed && at_fn_log_failure
$at_traceon; }



# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:675:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:675"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:675"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:675:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:675"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:675"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:675: cat stderr"
at_fn_check_prepare_trace "calc.at:675"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:675"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:675:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:675"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:675"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:675: cat stderr"
at_fn_check_prepare_trace "calc.at:675"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:675"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:675:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:675"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:675"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:675: cat stderr"
at_fn_check_prepare_trace "calc.at:675"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:675"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:675:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:675"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:675"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:675: cat stderr"
at_fn_check_prepare_trace "calc.at:675"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:675"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:675:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:675"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:675"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:675: cat stderr"
at_fn_check_prepare_trace "calc.at:675"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:675"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:675:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:675"
( $at_check_trace;  $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:675"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:675: cat stderr"
at_fn_check_prepare_trace "calc.at:675"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:675"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:675:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:675"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:675"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:675: cat stderr"
at_fn_check_prepare_trace "calc.at:675"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:675"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:675:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:675"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:675"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:675: cat stderr"
at_fn_check_prepare_trace "calc.at:675"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:675"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:675:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:675"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:675"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:675: cat stderr"
at_fn_check_prepare_trace "calc.at:675"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:675"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check that yyerrok works properly: second error is not reported,
# third and fourth are.  Parse status is succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:675:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:675"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:675"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:675: cat stderr"
at_fn_check_prepare_trace "calc.at:675"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:675"
$at_failed && at_fn_log_failure
$at_traceon; }



























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_159
#AT_START_160
# 160. calc.at:677: Calculator %language "C++" %glr-parser %defines %locations %pure-parser %error-verbose %debug %name-prefix "calc" %verbose %yacc
at_setup_line='calc.at:677'
at_fn_banner 13
at_desc="Calculator %language \"C++\" %glr-parser %defines %locations %pure-parser %error-verbose %debug %name-prefix \"calc\" %verbose %yacc"
at_desc_line="160: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "160. calc.at:677: testing ..."
  $at_traceon









# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.














cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%language "C++" %glr-parser %defines %locations %pure-parser %error-verbose %debug %name-prefix "calc" %verbose %yacc
%define global_tokens_and_yystype
%code requires {
/* Exercise pre-prologue dependency to %union.  */
typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};

%code provides {
#include <stdio.h>
/* The input.  */
extern FILE *input;
#ifndef YYLTYPE
# define YYLTYPE calc::location
#endif
#define first_line   begin.line
#define first_column begin.column
#define last_line    end.line
#define last_column  end.column
}

%code {
#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#else
# undef alarm
# define alarm(seconds) /* empty */
#endif
#define USE(Var)

FILE *input;
static semantic_value global_result = 0;
static int global_count = 0;
static int power (int base, int exponent);

int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
}

/* The lalr1.cc skeleton, for backward compatibility, defines
   a constructor for position that initializes the filename.  The
   glr.cc skeleton does not (and in fact cannot: location/position
   are stored in a union, from which objects with constructors are
   excluded in C++. */
%initial-action {
  @$.initialize (0);
}


/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type  <ival> exp

%nonassoc '=' /* comparison	       */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line         {  }
;

line:
  '\n'
| exp '\n'           { USE ($1); }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

/* A C++ error reporting function.  */
void
calc::parser::error (const location& l, const std::string& m)
{
  (void) l;
  std::cerr << l << ": " << m << std::endl;
}

int
yyparse ()
{
  calc::parser parser;
#if YYDEBUG
  parser.set_debug_level (1);
#endif
  return parser.parse ();
}




static int
power (int base, int exponent)
{
  int res = 1;
  if (exponent < 0)
    exit (3);
  for (/* Niente */; exponent; --exponent)
    res *= base;
  return res;
}


int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* This used to be alarm (10), but that isn't enough time for
     a July 1995 vintage DEC Alphastation 200 4/100 system,
     according to Nelson H. F. Beebe.  100 seconds is enough.  */
  alarm (100);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse ();
  fclose (input);
  if (global_result != result)
    abort ();
  if (global_count != count)
    abort ();
  return status;
}
_ATEOF


cat >calc-lex.cc <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.hh"

#include <ctype.h>

int calclex (YYSTYPE *lvalp, YYLTYPE *llocp);
static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp);
static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c);


static YYLTYPE last_yylloc;

static int
get_char (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int res = getc (input);
  (void) lvalp;(void) llocp;

  last_yylloc = (*llocp);
  if (res == '\n')
    {
      (*llocp).last_line++;
      (*llocp).last_column = 1;
    }
  else
    (*llocp).last_column++;

  return res;
}

static void
unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c)
{
  (void) lvalp;(void) llocp;

  /* Wrong when C == `\n'. */
  (*llocp) = last_yylloc;

  ungetc (c, input);
}

static int
read_signed_integer (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int c = get_char (lvalp, llocp);
  int sign = 1;
  int n = 0;

  (void) lvalp;(void) llocp;
  if (c == '-')
    {
      c = get_char (lvalp, llocp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp, llocp);
    }

  unget_char (lvalp, llocp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number.  Skips all   |
| blanks and tabs, returns 0 for EOF.                            |
`---------------------------------------------------------------*/

int
calclex (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  static int init = 1;
  int c;

  if (init)
    {
      init = 0;

      (*llocp).last_column = 1;
      (*llocp).last_line = 1;

    }


 (*llocp).first_column = (*llocp).last_column;
  (*llocp).first_line   = (*llocp).last_line;


  /* Skip white space.  */
  while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t')
    {
     (*llocp).first_column = (*llocp).last_column;
      (*llocp).first_line   = (*llocp).last_line;

    }

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp, llocp,  c);
      (*lvalp).ival = read_signed_integer (lvalp, llocp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}
_ATEOF





if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/calc.at:677: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.cc calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:677"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:677"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:677: bison --xml=xml-tests/test.xml -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:677"
( $at_check_trace; bison --xml=xml-tests/test.xml -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:677"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:677: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:677"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:677"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/calc.at:677: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:677"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:677"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/calc.at:677: bison -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:677"
( $at_check_trace; bison -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:677"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/calc.at:677: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:677"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:677"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:677: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc $LIBS" "calc.at:677"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:677"
$at_failed && at_fn_log_failure
$at_traceon; }



# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:677:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:677"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:677"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:677:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:677"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:677"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:677: cat stderr"
at_fn_check_prepare_trace "calc.at:677"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:677"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:677:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:677"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:677"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:677: cat stderr"
at_fn_check_prepare_trace "calc.at:677"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:677"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:677:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:677"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:677"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:677: cat stderr"
at_fn_check_prepare_trace "calc.at:677"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:677"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:677:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:677"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:677"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:677: cat stderr"
at_fn_check_prepare_trace "calc.at:677"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:677"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:677:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:677"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:677"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:677: cat stderr"
at_fn_check_prepare_trace "calc.at:677"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:677"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:677:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:677"
( $at_check_trace;  $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:677"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:677: cat stderr"
at_fn_check_prepare_trace "calc.at:677"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:677"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:677:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:677"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:677"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:677: cat stderr"
at_fn_check_prepare_trace "calc.at:677"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:677"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:677:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:677"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:677"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:677: cat stderr"
at_fn_check_prepare_trace "calc.at:677"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:677"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:677:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:677"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:677"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:677: cat stderr"
at_fn_check_prepare_trace "calc.at:677"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:677"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check that yyerrok works properly: second error is not reported,
# third and fourth are.  Parse status is succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:677:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:677"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:677"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:677: cat stderr"
at_fn_check_prepare_trace "calc.at:677"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:677"
$at_failed && at_fn_log_failure
$at_traceon; }



























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_160
#AT_START_161
# 161. calc.at:679: Calculator %language "C++" %glr-parser %defines %locations %pure-parser %error-verbose %debug %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}
at_setup_line='calc.at:679'
at_fn_banner 13
at_desc="Calculator %language \"C++\" %glr-parser %defines %locations %pure-parser %error-verbose %debug %name-prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}"
at_desc_line="161: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "161. calc.at:679: testing ..."
  $at_traceon









# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.














cat >calc.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Infix notation calculator--calc */
%language "C++" %glr-parser %defines %locations %pure-parser %error-verbose %debug %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}
%define global_tokens_and_yystype
%code requires {
/* Exercise pre-prologue dependency to %union.  */
typedef int semantic_value;
}

/* Exercise %union. */
%union
{
  semantic_value ival;
};

%code provides {
#include <stdio.h>
/* The input.  */
extern FILE *input;
#ifndef YYLTYPE
# define YYLTYPE calc::location
#endif
#define first_line   begin.line
#define first_column begin.column
#define last_line    end.line
#define last_column  end.column
}

%code {
#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#else
# undef alarm
# define alarm(seconds) /* empty */
#endif
#define USE(Var)

FILE *input;
static semantic_value global_result = 0;
static int global_count = 0;
static int power (int base, int exponent);

int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
}

/* The lalr1.cc skeleton, for backward compatibility, defines
   a constructor for position that initializes the filename.  The
   glr.cc skeleton does not (and in fact cannot: location/position
   are stored in a union, from which objects with constructors are
   excluded in C++. */
%initial-action {
  @$.initialize (0);
}


/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type  <ival> exp

%nonassoc '=' /* comparison	       */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line         { ++*count; ++global_count; }
;

line:
  '\n'
| exp '\n'           { *result = global_result = $1; }
;

exp:
  NUM                { $$ = $1;             }
| exp '=' exp
  {
    if ($1 != $3)
      fprintf (stderr, "calc: error: %d != %d\n", $1, $3);
    $$ = $1;
  }
| exp '+' exp        { $$ = $1 + $3;        }
| exp '-' exp        { $$ = $1 - $3;        }
| exp '*' exp        { $$ = $1 * $3;        }
| exp '/' exp        { $$ = $1 / $3;        }
| '-' exp  %prec NEG { $$ = -$2;            }
| exp '^' exp        { $$ = power ($1, $3); }
| '(' exp ')'        { $$ = $2;             }
| '(' error ')'      { $$ = 1111; yyerrok;  }
| '!'                { $$ = 0; YYERROR;     }
| '-' error          { $$ = 0; YYERROR;     }
;
%%

/* A C++ error reporting function.  */
void
calc::parser::error (const location& l, const std::string& m)
{
  (void) l;
  std::cerr << l << ": " << m << std::endl;
}

int
yyparse (semantic_value *result, int *count)
{
  calc::parser parser (result, count);
#if YYDEBUG
  parser.set_debug_level (1);
#endif
  return parser.parse ();
}




static int
power (int base, int exponent)
{
  int res = 1;
  if (exponent < 0)
    exit (3);
  for (/* Niente */; exponent; --exponent)
    res *= base;
  return res;
}


int
main (int argc, const char **argv)
{
  semantic_value result = 0;
  int count = 0;
  int status;

  /* This used to be alarm (10), but that isn't enough time for
     a July 1995 vintage DEC Alphastation 200 4/100 system,
     according to Nelson H. F. Beebe.  100 seconds is enough.  */
  alarm (100);

  if (argc == 2)
    input = fopen (argv[1], "r");
  else
    input = stdin;

  if (!input)
    {
      perror (argv[1]);
      return 3;
    }


  status = yyparse (&result, &count);
  fclose (input);
  if (global_result != result)
    abort ();
  if (global_count != count)
    abort ();
  return status;
}
_ATEOF


cat >calc-lex.cc <<'_ATEOF'
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc

#include "calc.hh"

#include <ctype.h>

int calclex (YYSTYPE *lvalp, YYLTYPE *llocp);
static int get_char (YYSTYPE *lvalp, YYLTYPE *llocp);
static void unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c);


static YYLTYPE last_yylloc;

static int
get_char (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int res = getc (input);
  (void) lvalp;(void) llocp;

  last_yylloc = (*llocp);
  if (res == '\n')
    {
      (*llocp).last_line++;
      (*llocp).last_column = 1;
    }
  else
    (*llocp).last_column++;

  return res;
}

static void
unget_char (YYSTYPE *lvalp, YYLTYPE *llocp,  int c)
{
  (void) lvalp;(void) llocp;

  /* Wrong when C == `\n'. */
  (*llocp) = last_yylloc;

  ungetc (c, input);
}

static int
read_signed_integer (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  int c = get_char (lvalp, llocp);
  int sign = 1;
  int n = 0;

  (void) lvalp;(void) llocp;
  if (c == '-')
    {
      c = get_char (lvalp, llocp);
      sign = -1;
    }

  while (isdigit (c))
    {
      n = 10 * n + (c - '0');
      c = get_char (lvalp, llocp);
    }

  unget_char (lvalp, llocp,  c);

  return sign * n;
}


/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number.  Skips all   |
| blanks and tabs, returns 0 for EOF.                            |
`---------------------------------------------------------------*/

int
calclex (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  static int init = 1;
  int c;

  if (init)
    {
      init = 0;

      (*llocp).last_column = 1;
      (*llocp).last_line = 1;

    }


 (*llocp).first_column = (*llocp).last_column;
  (*llocp).first_line   = (*llocp).last_line;


  /* Skip white space.  */
  while ((c = get_char (lvalp, llocp)) == ' ' || c == '\t')
    {
     (*llocp).first_column = (*llocp).last_column;
      (*llocp).first_line   = (*llocp).last_line;

    }

  /* process numbers   */
  if (c == '.' || isdigit (c))
    {
      unget_char (lvalp, llocp,  c);
      (*lvalp).ival = read_signed_integer (lvalp, llocp);
      return NUM;
    }

  /* Return end-of-file.  */
  if (c == EOF)
    return CALC_EOF;

  /* Return single chars. */
  return c;
}
_ATEOF





if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/calc.at:679: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o calc.cc calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:679"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/calc.at:679: bison --xml=xml-tests/test.xml -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:679"
( $at_check_trace; bison --xml=xml-tests/test.xml -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/calc.at:679: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:679"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/calc.at:679: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:679"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/calc.at:679: bison -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:679"
( $at_check_trace; bison -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/calc.at:679: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "calc.at:679"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/calc.at:679: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc $LIBS" "calc.at:679"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }



# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:679:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:679:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected number
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:679: cat stderr"
at_fn_check_prepare_trace "calc.at:679"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:679:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:679: cat stderr"
at_fn_check_prepare_trace "calc.at:679"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:679:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected $undefined
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:679: cat stderr"
at_fn_check_prepare_trace "calc.at:679"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:679:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error, unexpected '='
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:679: cat stderr"
at_fn_check_prepare_trace "calc.at:679"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:679:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error, unexpected '+'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:679: cat stderr"
at_fn_check_prepare_trace "calc.at:679"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/calc.at:679:  \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:679"
( $at_check_trace;  $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error, unexpected end of input
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:679: cat stderr"
at_fn_check_prepare_trace "calc.at:679"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:679:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.18: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1.23: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.41: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:679: cat stderr"
at_fn_check_prepare_trace "calc.at:679"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:679:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.10: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:679: cat stderr"
at_fn_check_prepare_trace "calc.at:679"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:679:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.12: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:679: cat stderr"
at_fn_check_prepare_trace "calc.at:679"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }



# Check that yyerrok works properly: second error is not reported,
# third and fourth are.  Parse status is succesfull.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF

{ set +x
$as_echo "$at_srcdir/calc.at:679:  \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:679"
( $at_check_trace;  $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '/^Starting/d
/^Entering/d
/^Stack/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^state/d
/^Cleanup:/d
/^Error:/d
/^Next/d
/^Now/d
/^Discarding/d
/ \$[0-9$]* = /d
/^yydestructor:/d' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.10: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1.16: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
_ATEOF

# 3. If locations are not used, remove them.

# 4. If error-verbose is not used, strip the`, unexpected....' part.

# 5. Check
{ set +x
$as_echo "$at_srcdir/calc.at:679: cat stderr"
at_fn_check_prepare_trace "calc.at:679"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:679"
$at_failed && at_fn_log_failure
$at_traceon; }



























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_161
#AT_START_162
# 162. torture.at:139: Big triangle
at_setup_line='torture.at:139'
at_fn_banner 14
at_desc="Big triangle"
at_desc_line="162: $at_desc                                   "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "162. torture.at:139: testing ..."
  $at_traceon


# I have been able to go up to 2000 on my machine.
# I tried 3000, a 29Mb grammar file, but then my system killed bison.
# With 500 and the new parser, which consume far too much memory,
# it gets killed too.  Of course the parser is to be cleaned.
cat >gengram.pl <<'_ATEOF'
#! /usr/bin/perl -w

use strict;
my $max = $ARGV[0] || 10;

print <<EOF;
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%error-verbose
%debug
%{
#include <stdio.h>
#include <stdlib.h>

static int yylex (void);
static void yyerror (const char *msg);
%}
%union
{
  int val;
};

%token END "end"
%type <val> exp input
EOF

for my $size (1 .. $max)
  {
    print "%token t$size $size \"$size\"\n";
  };

print <<EOF;
%%
input:
  exp        { if (\$1 != 0) abort (); \$\$ = \$1; }
| input exp  { if (\$2 != \$1 + 1) abort (); \$\$ = \$2; }
;

exp:
  END
    { \$\$ = 0; }
EOF

for my $size (1 .. $max)
  {
    use Text::Wrap;
    print wrap ("| ", "   ",
		(map { "\"$_\"" } (1 .. $size)),
		" END \n"),
		  "    { \$\$ = $size; }\n";
  };
print ";\n";

print <<EOF;
%%
static int
yylex (void)
{
  static int inner = 1;
  static int outer = 0;
  if (outer > $max)
    return 0;
  else if (inner > outer)
    {
      inner = 1;
      ++outer;
      return END;
    }
  return inner++;
}

static void
yyerror (const char *msg)
{
  fprintf (stderr, "%s\\n", msg);
}

int
main (void)
{
  yydebug = !!getenv ("YYDEBUG");
  return yyparse ();
}
EOF
_ATEOF


{ set +x
$as_echo "$at_srcdir/torture.at:145: perl -w ./gengram.pl 200 || exit 77"
at_fn_check_prepare_trace "torture.at:145"
( $at_check_trace; perl -w ./gengram.pl 200 || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:145"
$at_failed && at_fn_log_failure
$at_traceon; }

mv stdout input.y

{ set +x
$as_echo "$at_srcdir/torture.at:146: bison -v -o input.c input.y"
at_fn_check_prepare_trace "torture.at:146"
( $at_check_trace; bison -v -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:146"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/torture.at:147: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "torture.at:147"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:147"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/torture.at:148:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "torture.at:148"
( $at_check_trace;  $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:148"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_162
#AT_START_163
# 163. torture.at:232: Big horizontal
at_setup_line='torture.at:232'
at_fn_banner 14
at_desc="Big horizontal"
at_desc_line="163: $at_desc                                 "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "163. torture.at:232: testing ..."
  $at_traceon


# I have been able to go up to 10000 on my machine, but I had to
# increase the maximum stack size (* 100).  It gave:
#
# input.y      263k
# input.tab.c  1.3M
# input        453k
#
# gengram.pl 10000                 0.70s user 0.01s sys  99% cpu    0.711 total
# bison input.y                  730.56s user 0.53s sys  99% cpu 12:12.34 total
# gcc -Wall input.tab.c -o input   5.81s user 0.20s sys 100% cpu     6.01 total
# ./input                          0.00s user 0.01s sys 108% cpu     0.01 total
#
cat >gengram.pl <<'_ATEOF'
#! /usr/bin/perl -w

use strict;
my $max = $ARGV[0] || 10;

print <<EOF;
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%error-verbose
%debug
%{
#include <stdio.h>
#include <stdlib.h>

static int yylex (void);
static void yyerror (const char *msg);
%}

%token
EOF
for my $size (1 .. $max)
  {
    print "    t$size $size \"$size\"\n";
  };

print <<EOF;

%%
EOF

use Text::Wrap;
print
  wrap ("exp: ", "  ",
	(map { "\"$_\"" } (1 .. $max)), ";"),
  "\n";

print <<EOF;
%%
static int
yylex (void)
{
  static int counter = 1;
  if (counter <= $max)
    return counter++;
  if (counter++ != $max + 1)
    abort ();
  return 0;
}

static void
yyerror (const char *msg)
{
  fprintf (stderr, "%s\\n", msg);
}

int
main (void)
{
  yydebug = !!getenv ("YYDEBUG");
  return yyparse ();
}
EOF
_ATEOF


{ set +x
$as_echo "$at_srcdir/torture.at:246: perl -w ./gengram.pl 1000 || exit 77"
at_fn_check_prepare_trace "torture.at:246"
( $at_check_trace; perl -w ./gengram.pl 1000 || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:246"
$at_failed && at_fn_log_failure
$at_traceon; }

mv stdout input.y


# GNU m4 requires about 70 MiB for this test on a 32-bit host.
# Ask for 200 MiB, which should be plenty even on a 64-bit host.
data_limit=`(ulimit -S -d) 2>/dev/null`
case $data_limit in
[0-9]*)
  if test "$data_limit" -lt 204000; then
    { set +x
$as_echo "$at_srcdir/torture.at:250: ulimit -S -d 204000 || exit 77"
at_fn_check_prepare_trace "torture.at:250"
( $at_check_trace; ulimit -S -d 204000 || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:250"
$at_failed && at_fn_log_failure
$at_traceon; }

    ulimit -S -d 204000
  fi
esac

{ set +x
$as_echo "$at_srcdir/torture.at:252: bison -v -o input.c input.y"
at_fn_check_prepare_trace "torture.at:252"
( $at_check_trace; bison -v -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:252"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/torture.at:253: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "torture.at:253"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:253"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/torture.at:254:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "torture.at:254"
( $at_check_trace;  $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:254"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_163
#AT_START_164
# 164. torture.at:372: Many lookahead tokens
at_setup_line='torture.at:372'
at_fn_banner 14
at_desc="Many lookahead tokens"
at_desc_line="164: $at_desc                          "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "164. torture.at:372: testing ..."
  $at_traceon


cat >gengram.pl <<'_ATEOF'
#! /usr/bin/perl -w

use strict;
use Text::Wrap;
my $max = $ARGV[0] || 10;

print <<EOF;
%error-verbose
%debug
%{
# include <stdio.h>
# include <stdlib.h>
# include <assert.h>

static int yylex (void);
static void yyerror (const char *msg);
%}
%union
{
  int val;
};

%type <val> input exp
%token token
EOF

print
  wrap ("%type <val> ",
	"            ",
	map { "n$_" } (1 .. $max)),
  "\n";

print "%token\n";
for my $count (1 .. $max)
  {
    print "    t$count $count \"$count\"\n";
  };

print <<EOF;
%%
input:
  exp        { assert (\$1 == 1); \$\$ = \$1; }
| input exp  { assert (\$2 == \$1 + 1); \$\$ = \$2; }
;

exp:
  n1 "1" { assert (\$1 == 1); \$\$ = \$1; }
EOF

for my $count (2 .. $max)
  {
    print "| n$count \"$count\" { assert (\$1 == $count); \$\$ = \$1; }\n";
  };
print ";\n";

for my $count (1 .. $max)
  {
    print "n$count: token { \$\$ = $count; };\n";
  };

print <<EOF;
%%
static int
yylex (void)
{
  static int return_token = 1;
  static int counter = 1;
  if (counter > $max)
    {
      if (counter++ != $max + 1)
	abort ();
      return 0;
    }
  if (return_token)
    {
      return_token = 0;
      return token;
    }
  return_token = 1;
  return counter++;
}

static void
yyerror (const char *msg)
{
  fprintf (stderr, "%s\\n", msg);
}

int
main (void)
{
  yydebug = !!getenv ("YYDEBUG");
  return yyparse ();
}
EOF
_ATEOF


{ set +x
$as_echo "$at_srcdir/torture.at:374: perl -w ./gengram.pl 1000 || exit 77"
at_fn_check_prepare_trace "torture.at:374"
( $at_check_trace; perl -w ./gengram.pl 1000 || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:374"
$at_failed && at_fn_log_failure
$at_traceon; }

mv stdout input.y


# GNU m4 requires about 70 MiB for this test on a 32-bit host.
# Ask for 200 MiB, which should be plenty even on a 64-bit host.
data_limit=`(ulimit -S -d) 2>/dev/null`
case $data_limit in
[0-9]*)
  if test "$data_limit" -lt 204000; then
    { set +x
$as_echo "$at_srcdir/torture.at:378: ulimit -S -d 204000 || exit 77"
at_fn_check_prepare_trace "torture.at:378"
( $at_check_trace; ulimit -S -d 204000 || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:378"
$at_failed && at_fn_log_failure
$at_traceon; }

    ulimit -S -d 204000
  fi
esac

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/torture.at:380: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -v -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "torture.at:380"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -v -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:380"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/torture.at:380: bison --xml=xml-tests/test.xml -v -o input.c input.y"
at_fn_check_prepare_trace "torture.at:380"
( $at_check_trace; bison --xml=xml-tests/test.xml -v -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:380"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/torture.at:380: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:380"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:380"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/torture.at:380: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:380"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:380"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/torture.at:380: bison -v -o input.c input.y"
at_fn_check_prepare_trace "torture.at:380"
( $at_check_trace; bison -v -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:380"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/torture.at:381: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "torture.at:381"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:381"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/torture.at:382:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "torture.at:382"
( $at_check_trace;  $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:382"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_164
#AT_START_165
# 165. torture.at:473: Exploding the Stack Size with Alloca
at_setup_line='torture.at:473'
at_fn_banner 14
at_desc="Exploding the Stack Size with Alloca"
at_desc_line="165: $at_desc           "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "165. torture.at:473: testing ..."
  $at_traceon




# A grammar of parens growing the stack thanks to right recursion.
# exp:
cat >input.y <<'_ATEOF'
%{
#include <errno.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>

#if (defined __GNUC__ || defined __BUILTIN_VA_ARG_INCR \
     || defined _AIX || defined _MSC_VER || defined _ALLOCA_H)
# define YYSTACK_USE_ALLOCA 1
#endif

  static int yylex (void);
  static void yyerror (const char *msg);
%}

%error-verbose
%debug
%token WAIT_FOR_EOF
%%
exp: WAIT_FOR_EOF exp | ;
%%
static void
yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}

static int
yylex (void)
{
  if (yylval < 0)
    abort ();
  if (yylval--)
    return WAIT_FOR_EOF;
  else
    return EOF;
}

int
main (int argc, const char **argv)
{
  char *endp;
  YYSTYPE yylval_init;
  if (argc != 2)
    abort ();
  yylval_init = strtol (argv[1], &endp, 10);
  if (! (argv[1] != endp
	 && 0 <= yylval_init && yylval_init <= INT_MAX
	 && errno != ERANGE))
    abort ();
  yydebug = 1;
  {
    int count;
    int status;
    for (count = 0; count < 2; ++count)
      {
        int new_status;
        yylval = yylval_init;
        new_status = yyparse ();
        if (count > 0 && new_status != status)
          abort ();
        status = new_status;
      }
    return status;
  }
}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/torture.at:482: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "torture.at:482"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:482"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/torture.at:482: bison --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_trace "torture.at:482"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:482"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/torture.at:482: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:482"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:482"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/torture.at:482: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:482"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:482"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/torture.at:482: bison -o input.c input.y"
at_fn_check_prepare_trace "torture.at:482"
( $at_check_trace; bison -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:482"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/torture.at:482: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "torture.at:482"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:482"
$at_failed && at_fn_log_failure
$at_traceon; }



# Below the limit of 200.
{ set +x
$as_echo "$at_srcdir/torture.at:485: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 20"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 20" "torture.at:485"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 20
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:485"
$at_failed && at_fn_log_failure
$at_traceon; }

# Two enlargements: 2 * 2 * 200.
{ set +x
$as_echo "$at_srcdir/torture.at:488: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 900"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 900" "torture.at:488"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 900
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:488"
$at_failed && at_fn_log_failure
$at_traceon; }

# Fails: beyond the limit of 10,000 (which we don't reach anyway since we
# multiply by two starting at 200 => 5120 is the last possible).
{ set +x
$as_echo "$at_srcdir/torture.at:492: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 10000"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 10000" "torture.at:492"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 10000
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/torture.at:492"
$at_failed && at_fn_log_failure
$at_traceon; }


# The push parser can't use alloca since the stacks can't be locals.  This test
# just helps guarantee we don't let the YYSTACK_USE_ALLOCA feature affect
# push parsers.
# A grammar of parens growing the stack thanks to right recursion.
# exp:
cat >input.y <<'_ATEOF'
%{
#include <errno.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>

#if (defined __GNUC__ || defined __BUILTIN_VA_ARG_INCR \
     || defined _AIX || defined _MSC_VER || defined _ALLOCA_H)
# define YYSTACK_USE_ALLOCA 1
#endif

  static int yylex (void);
  static void yyerror (const char *msg);
%}
%define api.push_pull "both"

%error-verbose
%debug
%token WAIT_FOR_EOF
%%
exp: WAIT_FOR_EOF exp | ;
%%
static void
yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}

static int
yylex (void)
{
  if (yylval < 0)
    abort ();
  if (yylval--)
    return WAIT_FOR_EOF;
  else
    return EOF;
}

int
main (int argc, const char **argv)
{
  char *endp;
  YYSTYPE yylval_init;
  if (argc != 2)
    abort ();
  yylval_init = strtol (argv[1], &endp, 10);
  if (! (argv[1] != endp
	 && 0 <= yylval_init && yylval_init <= INT_MAX
	 && errno != ERANGE))
    abort ();
  yydebug = 1;
  {
    int count;
    int status;
    for (count = 0; count < 2; ++count)
      {
        int new_status;
        yylval = yylval_init;
        new_status = yyparse ();
        if (count > 0 && new_status != status)
          abort ();
        status = new_status;
      }
    return status;
  }
}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/torture.at:498: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "torture.at:498"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:498"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/torture.at:498: bison --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_trace "torture.at:498"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:498"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/torture.at:498: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:498"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:498"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/torture.at:498: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:498"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:498"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/torture.at:498: bison -o input.c input.y"
at_fn_check_prepare_trace "torture.at:498"
( $at_check_trace; bison -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:498"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/torture.at:498: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "torture.at:498"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:498"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/torture.at:501: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 20"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 20" "torture.at:501"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 20
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:501"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/torture.at:503: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 900"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 900" "torture.at:503"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 900
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:503"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/torture.at:505: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 10000"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 10000" "torture.at:505"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 10000
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/torture.at:505"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_165
#AT_START_166
# 166. torture.at:519: Exploding the Stack Size with Malloc
at_setup_line='torture.at:519'
at_fn_banner 14
at_desc="Exploding the Stack Size with Malloc"
at_desc_line="166: $at_desc           "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "166. torture.at:519: testing ..."
  $at_traceon




# A grammar of parens growing the stack thanks to right recursion.
# exp:
cat >input.y <<'_ATEOF'
%{
#include <errno.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#define YYSTACK_USE_ALLOCA 0
  static int yylex (void);
  static void yyerror (const char *msg);
%}

%error-verbose
%debug
%token WAIT_FOR_EOF
%%
exp: WAIT_FOR_EOF exp | ;
%%
static void
yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}

static int
yylex (void)
{
  if (yylval < 0)
    abort ();
  if (yylval--)
    return WAIT_FOR_EOF;
  else
    return EOF;
}

int
main (int argc, const char **argv)
{
  char *endp;
  YYSTYPE yylval_init;
  if (argc != 2)
    abort ();
  yylval_init = strtol (argv[1], &endp, 10);
  if (! (argv[1] != endp
	 && 0 <= yylval_init && yylval_init <= INT_MAX
	 && errno != ERANGE))
    abort ();
  yydebug = 1;
  {
    int count;
    int status;
    for (count = 0; count < 2; ++count)
      {
        int new_status;
        yylval = yylval_init;
        new_status = yyparse ();
        if (count > 0 && new_status != status)
          abort ();
        status = new_status;
      }
    return status;
  }
}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/torture.at:523: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "torture.at:523"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:523"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/torture.at:523: bison --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_trace "torture.at:523"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:523"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/torture.at:523: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:523"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:523"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/torture.at:523: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:523"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:523"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/torture.at:523: bison -o input.c input.y"
at_fn_check_prepare_trace "torture.at:523"
( $at_check_trace; bison -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:523"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/torture.at:523: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "torture.at:523"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:523"
$at_failed && at_fn_log_failure
$at_traceon; }



# Below the limit of 200.
{ set +x
$as_echo "$at_srcdir/torture.at:526: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 20"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 20" "torture.at:526"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 20
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:526"
$at_failed && at_fn_log_failure
$at_traceon; }

# Two enlargements: 2 * 2 * 200.
{ set +x
$as_echo "$at_srcdir/torture.at:529: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 900"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 900" "torture.at:529"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 900
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:529"
$at_failed && at_fn_log_failure
$at_traceon; }

# Fails: beyond the limit of 10,000 (which we don't reach anyway since we
# multiply by two starting at 200 => 5120 is the possible).
{ set +x
$as_echo "$at_srcdir/torture.at:533: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 10000"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 10000" "torture.at:533"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 10000
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/torture.at:533"
$at_failed && at_fn_log_failure
$at_traceon; }


# A grammar of parens growing the stack thanks to right recursion.
# exp:
cat >input.y <<'_ATEOF'
%{
#include <errno.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#define YYSTACK_USE_ALLOCA 0
  static int yylex (void);
  static void yyerror (const char *msg);
%}
%define api.push_pull "both"

%error-verbose
%debug
%token WAIT_FOR_EOF
%%
exp: WAIT_FOR_EOF exp | ;
%%
static void
yyerror (const char *msg)
{
  fprintf (stderr, "%s\n", msg);
}

static int
yylex (void)
{
  if (yylval < 0)
    abort ();
  if (yylval--)
    return WAIT_FOR_EOF;
  else
    return EOF;
}

int
main (int argc, const char **argv)
{
  char *endp;
  YYSTYPE yylval_init;
  if (argc != 2)
    abort ();
  yylval_init = strtol (argv[1], &endp, 10);
  if (! (argv[1] != endp
	 && 0 <= yylval_init && yylval_init <= INT_MAX
	 && errno != ERANGE))
    abort ();
  yydebug = 1;
  {
    int count;
    int status;
    for (count = 0; count < 2; ++count)
      {
        int new_status;
        yylval = yylval_init;
        new_status = yyparse ();
        if (count > 0 && new_status != status)
          abort ();
        status = new_status;
      }
    return status;
  }
}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/torture.at:536: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "torture.at:536"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:536"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/torture.at:536: bison --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_trace "torture.at:536"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:536"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/torture.at:536: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:536"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:536"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/torture.at:536: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "torture.at:536"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:536"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/torture.at:536: bison -o input.c input.y"
at_fn_check_prepare_trace "torture.at:536"
( $at_check_trace; bison -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:536"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/torture.at:536: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "torture.at:536"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:536"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/torture.at:539: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 20"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 20" "torture.at:539"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 20
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:539"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/torture.at:541: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 900"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 900" "torture.at:541"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 900
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/torture.at:541"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/torture.at:543: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 10000"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 10000" "torture.at:543"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 10000
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/torture.at:543"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_166
#AT_START_167
# 167. existing.at:24: GNU AWK Grammar
at_setup_line='existing.at:24'
at_fn_banner 15
at_desc="GNU AWK Grammar"
at_desc_line="167: $at_desc                                "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "167. existing.at:24: testing ..."
  $at_traceon


# We have been careful to strip all the actions excepts the
# mid-rule actions.  We rely on %expect to check that there are
# indeed 65 SR conflicts.
#
# Bison was once wrong, due to an incorrect computation of nullable.
# It reported 485 SR conflicts!

cat >input.y <<'_ATEOF'
%expect 65

%token FUNC_CALL NAME REGEXP
%token ERROR
%token YNUMBER YSTRING
%token RELOP APPEND_OP
%token ASSIGNOP MATCHOP NEWLINE CONCAT_OP
%token LEX_BEGIN LEX_END LEX_IF LEX_ELSE LEX_RETURN LEX_DELETE
%token LEX_WHILE LEX_DO LEX_FOR LEX_BREAK LEX_CONTINUE
%token LEX_PRINT LEX_PRINTF LEX_NEXT LEX_EXIT LEX_FUNCTION
%token LEX_GETLINE LEX_NEXTFILE
%token LEX_IN
%token LEX_AND LEX_OR INCREMENT DECREMENT
%token LEX_BUILTIN LEX_LENGTH

/* Lowest to highest */
%right ASSIGNOP
%right '?' ':'
%left LEX_OR
%left LEX_AND
%left LEX_GETLINE
%nonassoc LEX_IN
%left FUNC_CALL LEX_BUILTIN LEX_LENGTH
%nonassoc ','
%nonassoc MATCHOP
%nonassoc RELOP '<' '>' '|' APPEND_OP TWOWAYIO
%left CONCAT_OP
%left YSTRING YNUMBER
%left '+' '-'
%left '*' '/' '%'
%right '!' UNARY
%right '^'
%left INCREMENT DECREMENT
%left '$'
%left '(' ')'
%%

start
	: opt_nls program opt_nls
	;

program
	: rule
	| program rule
	| error
	| program error
	| /* empty */
	;

rule
	: LEX_BEGIN {} action
	| LEX_END {}   action
	| LEX_BEGIN statement_term
	| LEX_END statement_term
	| pattern action
	| action
	| pattern statement_term
	| function_prologue function_body
	;

func_name
	: NAME
	| FUNC_CALL
	| lex_builtin
	;

lex_builtin
	: LEX_BUILTIN
	| LEX_LENGTH
	;

function_prologue
	: LEX_FUNCTION {} func_name '(' opt_param_list r_paren opt_nls
	;

function_body
	: l_brace statements r_brace opt_semi opt_nls
	| l_brace r_brace opt_semi opt_nls
	;

pattern
	: exp
	| exp ',' exp
	;

regexp
	/*
	 * In this rule, want_regexp tells yylex that the next thing
	 * is a regexp so it should read up to the closing slash.
	 */
	: '/' {} REGEXP '/'
	;

action
	: l_brace statements r_brace opt_semi opt_nls
	| l_brace r_brace opt_semi opt_nls
	;

statements
	: statement
	| statements statement
	| error
	| statements error
	;

statement_term
	: nls
	| semi opt_nls
	;

statement
	: semi opt_nls
	| l_brace r_brace
	| l_brace statements r_brace
	| if_statement
	| LEX_WHILE '(' exp r_paren opt_nls statement
	| LEX_DO opt_nls statement LEX_WHILE '(' exp r_paren opt_nls
	| LEX_FOR '(' NAME LEX_IN NAME r_paren opt_nls statement
	| LEX_FOR '(' opt_exp semi opt_nls exp semi opt_nls opt_exp r_paren opt_nls statement
	| LEX_FOR '(' opt_exp semi opt_nls semi opt_nls opt_exp r_paren opt_nls statement
	| LEX_BREAK statement_term
	| LEX_CONTINUE statement_term
	| print '(' expression_list r_paren output_redir statement_term
	| print opt_rexpression_list output_redir statement_term
	| LEX_NEXT statement_term
	| LEX_NEXTFILE statement_term
	| LEX_EXIT opt_exp statement_term
	| LEX_RETURN {} opt_exp statement_term
	| LEX_DELETE NAME '[' expression_list ']' statement_term
	| LEX_DELETE NAME  statement_term
	| exp statement_term
	;

print
	: LEX_PRINT
	| LEX_PRINTF
	;

if_statement
	: LEX_IF '(' exp r_paren opt_nls statement
	| LEX_IF '(' exp r_paren opt_nls statement
	     LEX_ELSE opt_nls statement
	;

nls
	: NEWLINE
	| nls NEWLINE
	;

opt_nls
	: /* empty */
	| nls
	;

input_redir
	: /* empty */
	| '<' simp_exp
	;

output_redir
	: /* empty */
	| '>' exp
	| APPEND_OP exp
	| '|' exp
	| TWOWAYIO exp
	;

opt_param_list
	: /* empty */
	| param_list
	;

param_list
	: NAME
	| param_list comma NAME
	| error
	| param_list error
	| param_list comma error
	;

/* optional expression, as in for loop */
opt_exp
	: /* empty */
	| exp
	;

opt_rexpression_list
	: /* empty */
	| rexpression_list
	;

rexpression_list
	: rexp
	| rexpression_list comma rexp
	| error
	| rexpression_list error
	| rexpression_list error rexp
	| rexpression_list comma error
	;

opt_expression_list
	: /* empty */
	| expression_list
	;

expression_list
	: exp
	| expression_list comma exp
	| error
	| expression_list error
	| expression_list error exp
	| expression_list comma error
	;

/* Expressions, not including the comma operator.  */
exp	: variable ASSIGNOP {} exp
	| '(' expression_list r_paren LEX_IN NAME
	| exp '|' LEX_GETLINE opt_variable
	| exp TWOWAYIO LEX_GETLINE opt_variable
	| LEX_GETLINE opt_variable input_redir
	| exp LEX_AND exp
	| exp LEX_OR exp
	| exp MATCHOP exp
	| regexp
	| '!' regexp %prec UNARY
	| exp LEX_IN NAME
	| exp RELOP exp
	| exp '<' exp
	| exp '>' exp
	| exp '?' exp ':' exp
	| simp_exp
	| exp simp_exp %prec CONCAT_OP
	;

rexp
	: variable ASSIGNOP {} rexp
	| rexp LEX_AND rexp
	| rexp LEX_OR rexp
	| LEX_GETLINE opt_variable input_redir
	| regexp
	| '!' regexp %prec UNARY
	| rexp MATCHOP rexp
	| rexp LEX_IN NAME
	| rexp RELOP rexp
	| rexp '?' rexp ':' rexp
	| simp_exp
	| rexp simp_exp %prec CONCAT_OP
	;

simp_exp
	: non_post_simp_exp
	/* Binary operators in order of decreasing precedence.  */
	| simp_exp '^' simp_exp
	| simp_exp '*' simp_exp
	| simp_exp '/' simp_exp
	| simp_exp '%' simp_exp
	| simp_exp '+' simp_exp
	| simp_exp '-' simp_exp
	| variable INCREMENT
	| variable DECREMENT
	;

non_post_simp_exp
	: '!' simp_exp %prec UNARY
	| '(' exp r_paren
	| LEX_BUILTIN
	  '(' opt_expression_list r_paren
	| LEX_LENGTH '(' opt_expression_list r_paren
	| LEX_LENGTH
	| FUNC_CALL '(' opt_expression_list r_paren
	| variable
	| INCREMENT variable
	| DECREMENT variable
	| YNUMBER
	| YSTRING
	| '-' simp_exp    %prec UNARY
	| '+' simp_exp    %prec UNARY
	;

opt_variable
	: /* empty */
	| variable
	;

variable
	: NAME
	| NAME '[' expression_list ']'
	| '$' non_post_simp_exp
	;

l_brace
	: '{' opt_nls
	;

r_brace
	: '}' opt_nls
	;

r_paren
	: ')'
	;

opt_semi
	: /* empty */
	| semi
	;

semi
	: ';'
	;

comma	: ',' opt_nls
	;

%%
_ATEOF


# Pass plenty of options, to exercise plenty of code, even if we
# don't actually check the output.  But SEGV is watching us, and
# so might do dmalloc.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/existing.at:354: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot --verbose --defines input.y"
at_fn_check_prepare_notrace 'an embedded newline' "existing.at:354"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot --verbose --defines input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:354"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/existing.at:354: bison --xml=xml-tests/test.xml --verbose --defines input.y"
at_fn_check_prepare_trace "existing.at:354"
( $at_check_trace; bison --xml=xml-tests/test.xml --verbose --defines input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:354"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/existing.at:354: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:354"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:354"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/existing.at:354: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:354"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:354"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/existing.at:354: bison --verbose --defines input.y"
at_fn_check_prepare_trace "existing.at:354"
( $at_check_trace; bison --verbose --defines input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:354"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_167
#AT_START_168
# 168. existing.at:362: GNU Cim Grammar
at_setup_line='existing.at:362'
at_fn_banner 15
at_desc="GNU Cim Grammar"
at_desc_line="168: $at_desc                                "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "168. existing.at:362: testing ..."
  $at_traceon


# GNU Cim, the GNU Simula 87 Compiler.

# Bison was once wrong, due to an incorrect computation of the RR conflicts.
# It reported 80 SR && 99 RR conflicts instead of 78/10!!!

cat >input.y <<'_ATEOF'
%union {}

%token
	HACTIVATE HAFTER /*HAND*/ HARRAY HAT
	HBEFORE HBEGIN HBOOLEAN
	HCHARACTER HCLASS /*HCOMMENT*/ HCONC
	HDELAY HDO
	HELSE HEND HEQ /*HEQV*/ HEXTERNAL
	HFOR
	HGE HGO HGOTO HGT
	HHIDDEN
	HIF /*HIMP*/ HIN HINNER HINSPECT HINTEGER HIS
	HLABEL HLE HLONG HLT
	HNAME HNE HNEW HNONE /*HNOT*/ HNOTEXT
	/*HOR*/ HOTHERWISE
	HPRIOR HPROCEDURE HPROTECTED
	HQUA
	HREACTIVATE HREAL HREF
	HSHORT HSTEP HSWITCH
	HTEXT HTHEN HTHIS HTO
	HUNTIL
	HVALUE HVAR HVIRTUAL
	HWHEN HWHILE

	HASSIGNVALUE HASSIGNREF
	/*HDOT*/ HPAREXPSEPARATOR HLABELSEPARATOR HSTATEMENTSEPARATOR
	HBEGPAR HENDPAR
	HEQR HNER
	HADD HSUB HMUL HDIV HINTDIV HEXP
	HDOTDOTDOT

%token HIDENTIFIER
%token HBOOLEANKONST HINTEGERKONST HCHARACTERKONST
%token HREALKONST
%token HTEXTKONST


%right HASSIGN
%left   HORELSE
%left   HANDTHEN
%left   HEQV
%left   HIMP
%left   HOR
%left   HAND

%left   HNOT

%left HVALRELOPERATOR HREFRELOPERATOR HOBJRELOPERATOR

%left	HCONC

%left HTERMOPERATOR
%left UNEAR
%left HFACTOROPERATOR
%left         HPRIMARYOPERATOR

%left   HQUA

%left   HDOT

%start  MAIN_MODULE
%%
/* GRAMATIKK FOR PROGRAM MODULES */
MAIN_MODULE     :       {}
			MODULS
		|	error HSTATEMENTSEPARATOR MBEE_DECLSTMS
		;
EXT_DECLARATION	:	HEXTERNAL
			MBEE_TYPE
			HPROCEDURE
				{}
			EXT_LIST
		|
			HEXTERNAL
			HIDENTIFIER
			HPROCEDURE
				{}
			HIDENTIFIER {}
			EXTERNAL_KIND_ITEM
		|	HEXTERNAL
			HCLASS
				{}
			EXT_LIST

		;
EXTERNAL_KIND_ITEM:	EXT_IDENT
			HOBJRELOPERATOR
				{}
			MBEE_TYPE HPROCEDURE
			HIDENTIFIER
				{}
			HEADING EMPTY_BLOCK
				{}
/*		|
			EXT_IDENT
				{}
			MBEE_REST_EXT_LIST
		;
MBEE_REST_EXT_LIST:	/* EMPTY
		|	HPAREXPSEPARATOR EXT_KIND_LIST
		;
EXT_KIND_LIST	:	EXT_KIND_ITEM
		|	EXT_KIND_LIST HPAREXPSEPARATOR EXT_KIND_ITEM
		;
EXT_KIND_ITEM	:	HIDENTIFIER
			EXT_IDENT
				{}*/
		;
EMPTY_BLOCK	:	/*EMPT*/
		|	HBEGIN HEND
		;
EXT_LIST	:	EXT_ITEM
		|	EXT_LIST HPAREXPSEPARATOR EXT_ITEM
		;
EXT_ITEM	:	HIDENTIFIER
			EXT_IDENT
		;
EXT_IDENT	:	/* EMPTY */
		|	HVALRELOPERATOR {}
			HTEXTKONST
		;
/* GRAMATIKK FOR TYPER */
NO_TYPE         :       /*EMPT*/
		;
MBEE_TYPE       :       NO_TYPE
		|       TYPE
		;
TYPE            :       HREF HBEGPAR
			HIDENTIFIER
				{}
			HENDPAR
		|       HTEXT
		|       HBOOLEAN
		|       HCHARACTER
		|       HSHORT HINTEGER
		|       HINTEGER
		|       HREAL
		|       HLONG HREAL
		;

/* GRAMATIKK FOR DEL AV SETNINGER */
MBEE_ELSE_PART  :       /*EMPT*/
/*		|	HELSE
			HIF
			EXPRESSION
			HTHEN   {}
			BLOCK   {}
			MBEE_ELSE_PART          {}*/
		|       HELSE   {}
			BLOCK
		;
FOR_LIST        :       FOR_LIST_ELEMENT
		|       FOR_LIST_ELEMENT
			HPAREXPSEPARATOR
			FOR_LIST
		;
FOR_LIST_ELEMENT:       EXPRESSION
			MBEE_F_L_EL_R_PT
		;
MBEE_F_L_EL_R_PT:       /*EMPT*/
		|       HWHILE
			EXPRESSION
		|       HSTEP
			EXPRESSION
			HUNTIL
			EXPRESSION
		;
GOTO            :       HGO
			HTO
		|       HGOTO
		;
CONN_STATE_R_PT :       WHEN_CLAUSE_LIST
		|       HDO   {}
			BLOCK
		;
WHEN_CLAUSE_LIST:       HWHEN
			HIDENTIFIER
			HDO    {}
			BLOCK
		|       WHEN_CLAUSE_LIST
			HWHEN
			HIDENTIFIER
			HDO    {}
			BLOCK
		;
MBEE_OTWI_CLAUS :       /*EMPT*/
		|       HOTHERWISE {}

			BLOCK
		;
ACTIVATOR	:	HACTIVATE
		|	HREACTIVATE
		;
SCHEDULE	:	/*EMPT*/
		|	ATDELAY EXPRESSION	{}
			PRIOR
		|	BEFOREAFTER		{}
			EXPRESSION
		;
ATDELAY		:	HAT
		|	HDELAY
		;
BEFOREAFTER	:	HBEFORE
		|	HAFTER
		;
PRIOR		:	/*EMPT*/
		|	HPRIOR
		;
/* GRAMATIKK FOR SETNINGER OG DEKLARASJONER */
MODULSTATEMENT  :       HWHILE
			EXPRESSION
			HDO     {}
			BLOCK
		|       HIF
			EXPRESSION
			HTHEN   {}
			BLOCK   {}
			MBEE_ELSE_PART
		|       HFOR
			HIDENTIFIER
			HASSIGN {}
			FOR_LIST
			HDO     {}
			BLOCK
		|       GOTO
			EXPRESSION
		|       HINSPECT
			EXPRESSION              {}
			CONN_STATE_R_PT
				{}
			MBEE_OTWI_CLAUS
		|       HINNER
		|       HIDENTIFIER
			HLABELSEPARATOR
				{}
			DECLSTATEMENT
		|       EXPRESSION_SIMP
			HBEGIN
				{}
			IMPORT_SPEC_MODULE
				{}
			MBEE_DECLSTMS
			HEND
		|	EXPRESSION_SIMP HBEGIN error HSTATEMENTSEPARATOR
			MBEE_DECLSTMS HEND
		|	EXPRESSION_SIMP HBEGIN error HEND
		|       EXPRESSION_SIMP
		|	ACTIVATOR EXPRESSION SCHEDULE
		|       HBEGIN
				{}
			MBEE_DECLSTMS
			HEND
		|       MBEE_TYPE HPROCEDURE
			HIDENTIFIER
				{}
			HEADING BLOCK
		|       HIDENTIFIER
			HCLASS
			NO_TYPE
				{}
			IMPORT_SPEC_MODULE
			HIDENTIFIER
				{}
			HEADING
			BLOCK
		|       HCLASS
			NO_TYPE
			HIDENTIFIER
				{}
			HEADING
			BLOCK
		|       EXT_DECLARATION
		|       /*EMPT*/
		;
IMPORT_SPEC_MODULE:
		;
DECLSTATEMENT	:	MODULSTATEMENT
		|       TYPE
			HIDENTIFIER
			MBEE_CONSTANT
			HPAREXPSEPARATOR
				{}
			IDENTIFIER_LISTC
		|       TYPE
			HIDENTIFIER
			MBEE_CONSTANT
		|       MBEE_TYPE
			HARRAY  {}
			ARR_SEGMENT_LIST
		|       HSWITCH
			HIDENTIFIER
			HASSIGN {}
			SWITCH_LIST
		;
BLOCK           :       DECLSTATEMENT
		|       HBEGIN MBEE_DECLSTMS HEND
		|	HBEGIN error HSTATEMENTSEPARATOR MBEE_DECLSTMS HEND
		|	HBEGIN error HEND
		;
MBEE_DECLSTMS   :       MBEE_DECLSTMSU
		;
MBEE_DECLSTMSU  :       DECLSTATEMENT
		|       MBEE_DECLSTMSU
			HSTATEMENTSEPARATOR
			DECLSTATEMENT
		;
MODULS		:	MODULSTATEMENT
		|	MODULS HSTATEMENTSEPARATOR MODULSTATEMENT
		;
/* GRAMATIKK FOR DEL AV DEKLARASJONER */
ARR_SEGMENT_LIST:       ARR_SEGMENT
		|       ARR_SEGMENT_LIST
			HPAREXPSEPARATOR
			ARR_SEGMENT
		;
ARR_SEGMENT	:       ARRAY_SEGMENT
			HBEGPAR
			BAUND_PAIR_LIST HENDPAR
		;
ARRAY_SEGMENT   :       ARRAY_SEGMENT_EL        {}

		|       ARRAY_SEGMENT_EL
			HPAREXPSEPARATOR
			ARRAY_SEGMENT
		;
ARRAY_SEGMENT_EL:       HIDENTIFIER
		;
BAUND_PAIR_LIST :       BAUND_PAIR
		|       BAUND_PAIR
			HPAREXPSEPARATOR
			BAUND_PAIR_LIST
		;
BAUND_PAIR      :       EXPRESSION
			HLABELSEPARATOR
			EXPRESSION
		;
SWITCH_LIST     :       EXPRESSION
		|       EXPRESSION
			HPAREXPSEPARATOR
			SWITCH_LIST
		;
HEADING         :       MBEE_FMAL_PAR_P HSTATEMENTSEPARATOR {}
			MBEE_MODE_PART  {}
			MBEE_SPEC_PART  {}
			MBEE_PROT_PART  {}
			MBEE_VIRT_PART
		;
MBEE_FMAL_PAR_P :       /*EMPT*/
		|       FMAL_PAR_PART
		;
FMAL_PAR_PART   :       HBEGPAR NO_TYPE
			MBEE_LISTV HENDPAR
		;
MBEE_LISTV      :       /*EMPT*/
		|       LISTV
		;
LISTV           :       HIDENTIFIER
		|	FPP_CATEG HDOTDOTDOT
		|       HIDENTIFIER     {}
			HPAREXPSEPARATOR LISTV
		|       FPP_SPEC
		|       FPP_SPEC
			HPAREXPSEPARATOR LISTV
		;
FPP_HEADING     :       HBEGPAR NO_TYPE
			FPP_MBEE_LISTV HENDPAR
		;
FPP_MBEE_LISTV  :       /*EMPT*/
		|       FPP_LISTV
		;
FPP_LISTV       :	FPP_CATEG HDOTDOTDOT
		|       FPP_SPEC
		|       FPP_SPEC
			HPAREXPSEPARATOR LISTV
		;
FPP_SPEC        :       FPP_CATEG SPECIFIER HIDENTIFIER
		|	FPP_CATEG FPP_PROC_DECL_IN_SPEC
		;
FPP_CATEG       :       HNAME HLABELSEPARATOR
		|       HVALUE HLABELSEPARATOR
		|       HVAR HLABELSEPARATOR
		|       /*EMPT*/
		;
FPP_PROC_DECL_IN_SPEC:	MBEE_TYPE HPROCEDURE
			HIDENTIFIER
					{}
			FPP_HEADING {} { /* Yes, two "final" actions. */ }
		;
IDENTIFIER_LISTV:       HIDENTIFIER
		|	HDOTDOTDOT
		|       HIDENTIFIER     {}
			HPAREXPSEPARATOR IDENTIFIER_LISTV
		;
MBEE_MODE_PART  :       /*EMPT*/
		|       MODE_PART
		;
MODE_PART       :       NAME_PART
		|       VALUE_PART
		|       VAR_PART
		|       NAME_PART VALUE_PART
		|       VALUE_PART NAME_PART
		|       NAME_PART VAR_PART
		|       VAR_PART NAME_PART
		|       VALUE_PART VAR_PART
		|       VAR_PART VALUE_PART
		|       VAR_PART NAME_PART VALUE_PART
		|       NAME_PART VAR_PART VALUE_PART
		|       NAME_PART VALUE_PART VAR_PART
		|       VAR_PART VALUE_PART NAME_PART
		|       VALUE_PART VAR_PART NAME_PART
		|       VALUE_PART NAME_PART VAR_PART
		;
NAME_PART       :       HNAME           {}
			IDENTIFIER_LISTV
			HSTATEMENTSEPARATOR
		;
VAR_PART        :       HVAR            {}
			IDENTIFIER_LISTV
			HSTATEMENTSEPARATOR
		;
VALUE_PART      :       HVALUE          {}
			IDENTIFIER_LISTV HSTATEMENTSEPARATOR
		;
MBEE_SPEC_PART  :       /*EMPT*/
		|       SPEC_PART
		;
SPEC_PART       :       ONE_SPEC
		|       SPEC_PART ONE_SPEC
		;
ONE_SPEC	:	SPECIFIER IDENTIFIER_LIST HSTATEMENTSEPARATOR
		|	NO_TYPE HPROCEDURE HIDENTIFIER HOBJRELOPERATOR
			  {}
			PROC_DECL_IN_SPEC HSTATEMENTSEPARATOR
		|       FPP_PROC_DECL_IN_SPEC HSTATEMENTSEPARATOR
		|       MBEE_TYPE HPROCEDURE HIDENTIFIER HSTATEMENTSEPARATOR
		|       MBEE_TYPE HPROCEDURE HIDENTIFIER HPAREXPSEPARATOR
			IDENTIFIER_LIST HSTATEMENTSEPARATOR
		;
SPECIFIER       :       TYPE
		|       MBEE_TYPE
			HARRAY
		|       HLABEL
		|       HSWITCH
		;
PROC_DECL_IN_SPEC:	MBEE_TYPE HPROCEDURE
			HIDENTIFIER
					{}
			HEADING
					{}
			MBEE_BEGIN_END
		;
MBEE_BEGIN_END	:	/* EMPTY */
		|	HBEGIN HEND
		;
MBEE_PROT_PART  :       /*EMPT*/
		|       PROTECTION_PART
		;
PROTECTION_PART :       PROT_SPECIFIER IDENTIFIER_LIST
			HSTATEMENTSEPARATOR
		|       PROTECTION_PART  PROT_SPECIFIER
			IDENTIFIER_LIST HSTATEMENTSEPARATOR
		;
PROT_SPECIFIER  :       HHIDDEN
		|       HPROTECTED
		|       HHIDDEN
			HPROTECTED
		|       HPROTECTED
			HHIDDEN
		;
MBEE_VIRT_PART  :       /*EMPT*/
		|       VIRTUAL_PART
		;
VIRTUAL_PART    :       HVIRTUAL
			HLABELSEPARATOR
			MBEE_SPEC_PART
		;
IDENTIFIER_LIST :       HIDENTIFIER
		|       IDENTIFIER_LIST HPAREXPSEPARATOR
			HIDENTIFIER
		;
IDENTIFIER_LISTC:       HIDENTIFIER
			MBEE_CONSTANT
		|       IDENTIFIER_LISTC HPAREXPSEPARATOR
			HIDENTIFIER
			MBEE_CONSTANT
		;
MBEE_CONSTANT	:	/* EMPTY */
		|	HVALRELOPERATOR
				{}
			EXPRESSION
		;

/* GRAMATIKK FOR UTTRYKK */
EXPRESSION      :       EXPRESSION_SIMP
		|       HIF
			EXPRESSION
			HTHEN
			EXPRESSION
			HELSE
			EXPRESSION
		;
EXPRESSION_SIMP :	EXPRESSION_SIMP
			HASSIGN
			EXPRESSION
		|

			EXPRESSION_SIMP
			HCONC
			EXPRESSION_SIMP
		|       EXPRESSION_SIMP HOR
			HELSE
			EXPRESSION_SIMP
			%prec HORELSE
		|       EXPRESSION_SIMP HAND
			HTHEN
			EXPRESSION_SIMP
			%prec HANDTHEN
		|       EXPRESSION_SIMP
			HEQV EXPRESSION_SIMP
		|       EXPRESSION_SIMP
			HIMP EXPRESSION_SIMP
		|       EXPRESSION_SIMP
			HOR EXPRESSION_SIMP
		|       EXPRESSION_SIMP
			HAND EXPRESSION_SIMP
		|       HNOT EXPRESSION_SIMP
		|       EXPRESSION_SIMP
			HVALRELOPERATOR
			EXPRESSION_SIMP
		|       EXPRESSION_SIMP
			HREFRELOPERATOR
			EXPRESSION_SIMP
		|       EXPRESSION_SIMP
			HOBJRELOPERATOR
			EXPRESSION_SIMP
		|       HTERMOPERATOR
			EXPRESSION_SIMP %prec UNEAR
		|       EXPRESSION_SIMP
			HTERMOPERATOR
			EXPRESSION_SIMP
		|       EXPRESSION_SIMP
			HFACTOROPERATOR
			EXPRESSION_SIMP
		|       EXPRESSION_SIMP
			HPRIMARYOPERATOR
			EXPRESSION_SIMP
		|       HBEGPAR
			EXPRESSION HENDPAR
		|       HTEXTKONST
		|       HCHARACTERKONST
		|       HREALKONST
		|       HINTEGERKONST
		|       HBOOLEANKONST
		|       HNONE
		|       HIDENTIFIER
				{}
			MBEE_ARG_R_PT
		|       HTHIS HIDENTIFIER
		|       HNEW
			HIDENTIFIER
			ARG_R_PT
		|       EXPRESSION_SIMP
			HDOT
			EXPRESSION_SIMP
		|       EXPRESSION_SIMP
			HQUA HIDENTIFIER
		;
ARG_R_PT        :       /*EMPTY*/
		|       HBEGPAR
			ARGUMENT_LIST HENDPAR
		;
MBEE_ARG_R_PT   :       /*EMPTY*/
		|       HBEGPAR
			ARGUMENT_LIST HENDPAR
		;
ARGUMENT_LIST   :       EXPRESSION
		|       EXPRESSION
			HPAREXPSEPARATOR
			ARGUMENT_LIST
		;
%%
_ATEOF


# Pass plenty of options, to exercise plenty of code, even if we
# don't actually check the output.  But SEGV is watching us, and
# so might do dmalloc.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/existing.at:956: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot --verbose --defines input.y"
at_fn_check_prepare_notrace 'an embedded newline' "existing.at:956"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot --verbose --defines input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:956"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/existing.at:956: bison --xml=xml-tests/test.xml --verbose --defines input.y"
at_fn_check_prepare_trace "existing.at:956"
( $at_check_trace; bison --xml=xml-tests/test.xml --verbose --defines input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:956"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/existing.at:956: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:956"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:956"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/existing.at:956: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:956"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:956"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/existing.at:956: bison --verbose --defines input.y"
at_fn_check_prepare_trace "existing.at:956"
( $at_check_trace; bison --verbose --defines input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y: conflicts: 78 shift/reduce, 10 reduce/reduce
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:956"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/existing.at:960: grep '^State.*conflicts:' input.output"
at_fn_check_prepare_trace "existing.at:960"
( $at_check_trace; grep '^State.*conflicts:' input.output
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "State 64 conflicts: 14 shift/reduce
State 164 conflicts: 1 shift/reduce
State 201 conflicts: 33 shift/reduce, 4 reduce/reduce
State 206 conflicts: 1 shift/reduce
State 240 conflicts: 1 shift/reduce
State 335 conflicts: 9 shift/reduce, 2 reduce/reduce
State 356 conflicts: 1 shift/reduce
State 360 conflicts: 9 shift/reduce, 2 reduce/reduce
State 427 conflicts: 9 shift/reduce, 2 reduce/reduce
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:960"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_168
#AT_START_169
# 169. existing.at:978: GNU pic Grammar
at_setup_line='existing.at:978'
at_fn_banner 15
at_desc="GNU pic Grammar"
at_desc_line="169: $at_desc                                "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "169. existing.at:978: testing ..."
  $at_traceon


# GNU pic, part of groff.

# Bison once reported shift/reduce conflicts that it shouldn't have.

cat >input.y <<'_ATEOF'
%union {}

%token LABEL
%token VARIABLE
%token NUMBER
%token TEXT
%token COMMAND_LINE
%token DELIMITED
%token ORDINAL
%token TH
%token LEFT_ARROW_HEAD
%token RIGHT_ARROW_HEAD
%token DOUBLE_ARROW_HEAD
%token LAST
%token UP
%token DOWN
%token LEFT
%token RIGHT
%token BOX
%token CIRCLE
%token ELLIPSE
%token ARC
%token LINE
%token ARROW
%token MOVE
%token SPLINE
%token HEIGHT
%token RADIUS
%token WIDTH
%token DIAMETER
%token FROM
%token TO
%token AT
%token WITH
%token BY
%token THEN
%token SOLID
%token DOTTED
%token DASHED
%token CHOP
%token SAME
%token INVISIBLE
%token LJUST
%token RJUST
%token ABOVE
%token BELOW
%token OF
%token THE
%token WAY
%token BETWEEN
%token AND
%token HERE
%token DOT_N
%token DOT_E
%token DOT_W
%token DOT_S
%token DOT_NE
%token DOT_SE
%token DOT_NW
%token DOT_SW
%token DOT_C
%token DOT_START
%token DOT_END
%token DOT_X
%token DOT_Y
%token DOT_HT
%token DOT_WID
%token DOT_RAD
%token SIN
%token COS
%token ATAN2
%token LOG
%token EXP
%token SQRT
%token K_MAX
%token K_MIN
%token INT
%token RAND
%token SRAND
%token COPY
%token THRU
%token TOP
%token BOTTOM
%token UPPER
%token LOWER
%token SH
%token PRINT
%token CW
%token CCW
%token FOR
%token DO
%token IF
%token ELSE
%token ANDAND
%token OROR
%token NOTEQUAL
%token EQUALEQUAL
%token LESSEQUAL
%token GREATEREQUAL
%token LEFT_CORNER
%token RIGHT_CORNER
%token NORTH
%token SOUTH
%token EAST
%token WEST
%token CENTER
%token END
%token START
%token RESET
%token UNTIL
%token PLOT
%token THICKNESS
%token FILL
%token COLORED
%token OUTLINED
%token SHADED
%token ALIGNED
%token SPRINTF
%token COMMAND

%left '.'

/* this ensures that plot 17 "%g" parses as (plot 17 "%g") */
%left PLOT
%left TEXT SPRINTF

/* give text adjustments higher precedence than TEXT, so that
box "foo" above ljust == box ("foo" above ljust)
*/

%left LJUST RJUST ABOVE BELOW

%left LEFT RIGHT
/* Give attributes that take an optional expression a higher
precedence than left and right, so that eg `line chop left'
parses properly. */
%left CHOP SOLID DASHED DOTTED UP DOWN FILL COLORED OUTLINED
%left LABEL

%left VARIABLE NUMBER '(' SIN COS ATAN2 LOG EXP SQRT K_MAX K_MIN INT RAND SRAND LAST
%left ORDINAL HERE '`'

%left BOX CIRCLE ELLIPSE ARC LINE ARROW SPLINE '[' /* ] */

/* these need to be lower than '-' */
%left HEIGHT RADIUS WIDTH DIAMETER FROM TO AT THICKNESS

/* these must have higher precedence than CHOP so that `label %prec CHOP'
works */
%left DOT_N DOT_E DOT_W DOT_S DOT_NE DOT_SE DOT_NW DOT_SW DOT_C
%left DOT_START DOT_END TOP BOTTOM LEFT_CORNER RIGHT_CORNER
%left UPPER LOWER NORTH SOUTH EAST WEST CENTER START END

%left ','
%left OROR
%left ANDAND
%left EQUALEQUAL NOTEQUAL
%left '<' '>' LESSEQUAL GREATEREQUAL

%left BETWEEN OF
%left AND

%left '+' '-'
%left '*' '/' '%'
%right '!'
%right '^'

%%

top:
	optional_separator
	| element_list
	;

element_list:
	optional_separator middle_element_list optional_separator
	;

middle_element_list:
	element
	| middle_element_list separator element
	;

optional_separator:
	/* empty */
	| separator
	;

separator:
	';'
	| separator ';'
	;

placeless_element:
	VARIABLE '=' any_expr
	| VARIABLE ':' '=' any_expr
	| UP
	| DOWN
	| LEFT
	| RIGHT
	| COMMAND_LINE
	| COMMAND print_args
	| PRINT print_args
	| SH
		{}
	  DELIMITED
	| COPY TEXT
	| COPY TEXT THRU
		{}
	  DELIMITED
		{}
	  until
	| COPY THRU
		{}
	  DELIMITED
		{}
	  until
	| FOR VARIABLE '=' expr TO expr optional_by DO
		{}
	  DELIMITED
	| simple_if
	| simple_if ELSE
		{}
	  DELIMITED
	| reset_variables
	| RESET
	;

reset_variables:
	RESET VARIABLE
	| reset_variables VARIABLE
	| reset_variables ',' VARIABLE
	;

print_args:
	print_arg
	| print_args print_arg
	;

print_arg:
	expr							%prec ','
	| text
	| position						%prec ','
	;

simple_if:
	IF any_expr THEN
		{}
	DELIMITED
	;

until:
	/* empty */
	| UNTIL TEXT
	;

any_expr:
	expr
	| text_expr
	;

text_expr:
	text EQUALEQUAL text
	| text NOTEQUAL text
	| text_expr ANDAND text_expr
	| text_expr ANDAND expr
	| expr ANDAND text_expr
	| text_expr OROR text_expr
	| text_expr OROR expr
	| expr OROR text_expr
	| '!' text_expr
	;

optional_by:
	/* empty */
	| BY expr
	| BY '*' expr
	;

element:
	object_spec
	| LABEL ':' optional_separator element
	| LABEL ':' optional_separator position_not_place
	| LABEL ':' optional_separator place
	| '{' {} element_list '}'
		{}
	  optional_element
	| placeless_element
	;

optional_element:
	/* empty */
	| element
	;

object_spec:
	BOX
	| CIRCLE
	| ELLIPSE
	| ARC
	| LINE
	| ARROW
	| MOVE
	| SPLINE
	| text							%prec TEXT
	| PLOT expr
	| PLOT expr text
	| '['
		{}
	  element_list ']'
	| object_spec HEIGHT expr
	| object_spec RADIUS expr
	| object_spec WIDTH expr
	| object_spec DIAMETER expr
	| object_spec expr					%prec HEIGHT
	| object_spec UP
	| object_spec UP expr
	| object_spec DOWN
	| object_spec DOWN expr
	| object_spec RIGHT
	| object_spec RIGHT expr
	| object_spec LEFT
	| object_spec LEFT expr
	| object_spec FROM position
	| object_spec TO position
	| object_spec AT position
	| object_spec WITH path
	| object_spec WITH position				%prec ','
	| object_spec BY expr_pair
	| object_spec THEN
	| object_spec SOLID
	| object_spec DOTTED
	| object_spec DOTTED expr
	| object_spec DASHED
	| object_spec DASHED expr
	| object_spec FILL
	| object_spec FILL expr
	| object_spec SHADED text
	| object_spec COLORED text
	| object_spec OUTLINED text
	| object_spec CHOP
	| object_spec CHOP expr
	| object_spec SAME
	| object_spec INVISIBLE
	| object_spec LEFT_ARROW_HEAD
	| object_spec RIGHT_ARROW_HEAD
	| object_spec DOUBLE_ARROW_HEAD
	| object_spec CW
	| object_spec CCW
	| object_spec text					%prec TEXT
	| object_spec LJUST
	| object_spec RJUST
	| object_spec ABOVE
	| object_spec BELOW
	| object_spec THICKNESS expr
	| object_spec ALIGNED
	;

text:
	TEXT
	| SPRINTF '(' TEXT sprintf_args ')'
	;

sprintf_args:
	/* empty */
	| sprintf_args ',' expr
	;

position:
	position_not_place
	| place
	;

position_not_place:
	expr_pair
	| position '+' expr_pair
	| position '-' expr_pair
	| '(' position ',' position ')'
	| expr between position AND position
	| expr '<' position ',' position '>'
	;

between:
	BETWEEN
	| OF THE WAY BETWEEN
	;

expr_pair:
	expr ',' expr
	| '(' expr_pair ')'
	;

place:
	/* line at A left == line (at A) left */
	label							%prec CHOP
	| label corner
	| corner label
	| corner OF label
	| HERE
	;

label:
	LABEL
	| nth_primitive
	| label '.' LABEL
	;

ordinal:
	ORDINAL
	| '`' any_expr TH
	;

optional_ordinal_last:
	LAST
	| ordinal LAST
	;

nth_primitive:
	ordinal object_type
	| optional_ordinal_last object_type
	;

object_type:
	BOX
	| CIRCLE
	| ELLIPSE
	| ARC
	| LINE
	| ARROW
	| SPLINE
	| '[' ']'
	| TEXT
	;

label_path:
	'.' LABEL
	| label_path '.' LABEL
	;

relative_path:
	corner							%prec CHOP
	/* give this a lower precedence than LEFT and RIGHT so that
	   [A: box] with .A left == [A: box] with (.A left) */
	| label_path						%prec TEXT
	| label_path corner
	;

path:
	relative_path
	| '(' relative_path ',' relative_path ')'
		{}
	/* The rest of these rules are a compatibility sop. */
	| ORDINAL LAST object_type relative_path
	| LAST object_type relative_path
	| ORDINAL object_type relative_path
	| LABEL relative_path
	;

corner:
	DOT_N
	| DOT_E
	| DOT_W
	| DOT_S
	| DOT_NE
	| DOT_SE
	| DOT_NW
	| DOT_SW
	| DOT_C
	| DOT_START
	| DOT_END
	| TOP
	| BOTTOM
	| LEFT
	| RIGHT
	| UPPER LEFT
	| LOWER LEFT
	| UPPER RIGHT
	| LOWER RIGHT
	| LEFT_CORNER
	| RIGHT_CORNER
	| UPPER LEFT_CORNER
	| LOWER LEFT_CORNER
	| UPPER RIGHT_CORNER
	| LOWER RIGHT_CORNER
	| NORTH
	| SOUTH
	| EAST
	| WEST
	| CENTER
	| START
	| END
	;

expr:
	VARIABLE
	| NUMBER
	| place DOT_X
	| place DOT_Y
	| place DOT_HT
	| place DOT_WID
	| place DOT_RAD
	| expr '+' expr
	| expr '-' expr
	| expr '*' expr
	| expr '/' expr
	| expr '%' expr
	| expr '^' expr
	| '-' expr						%prec '!'
	| '(' any_expr ')'
	| SIN '(' any_expr ')'
	| COS '(' any_expr ')'
	| ATAN2 '(' any_expr ',' any_expr ')'
	| LOG '(' any_expr ')'
	| EXP '(' any_expr ')'
	| SQRT '(' any_expr ')'
	| K_MAX '(' any_expr ',' any_expr ')'
	| K_MIN '(' any_expr ',' any_expr ')'
	| INT '(' any_expr ')'
	| RAND '(' any_expr ')'
	| RAND '(' ')'
	| SRAND '(' any_expr ')'
	| expr '<' expr
	| expr LESSEQUAL expr
	| expr '>' expr
	| expr GREATEREQUAL expr
	| expr EQUALEQUAL expr
	| expr NOTEQUAL expr
	| expr ANDAND expr
	| expr OROR expr
	| '!' expr
	;
_ATEOF


# Pass plenty of options, to exercise plenty of code, even if we
# don't actually check the output.  But SEGV is watching us, and
# so might do dmalloc.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/existing.at:1521: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot --verbose --defines input.y"
at_fn_check_prepare_notrace 'an embedded newline' "existing.at:1521"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot --verbose --defines input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1521"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/existing.at:1521: bison --xml=xml-tests/test.xml --verbose --defines input.y"
at_fn_check_prepare_trace "existing.at:1521"
( $at_check_trace; bison --xml=xml-tests/test.xml --verbose --defines input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1521"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/existing.at:1521: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:1521"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1521"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/existing.at:1521: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "existing.at:1521"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1521"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/existing.at:1521: bison --verbose --defines input.y"
at_fn_check_prepare_trace "existing.at:1521"
( $at_check_trace; bison --verbose --defines input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:453.11-48: warning: rule useless in parser due to conflicts: path: ORDINAL LAST object_type relative_path
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1521"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_169
#AT_START_170
# 170. regression.at:25: Trivial grammars
at_setup_line='regression.at:25'
at_fn_banner 16
at_desc="Trivial grammars"
at_desc_line="170: $at_desc                               "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "170. regression.at:25: testing ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%{
void yyerror (char const *);
int yylex (void);
#define YYSTYPE int *
%}

%error-verbose

%%

program: 'x';
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/regression.at:41: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:41"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:41"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:41: bison --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_trace "regression.at:41"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:41"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:41: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:41"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:41"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/regression.at:41: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:41"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:41"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/regression.at:41: bison -o input.c input.y"
at_fn_check_prepare_trace "regression.at:41"
( $at_check_trace; bison -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:41"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:42: \$CC \$CFLAGS \$CPPFLAGS -o input.o -c input.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -o input.o -c input.c" "regression.at:42"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -o input.o -c input.c
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:42"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:43: \$CC \$CFLAGS \$CPPFLAGS -o input.o -DYYDEBUG -c input.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -o input.o -DYYDEBUG -c input.c" "regression.at:43"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -o input.o -DYYDEBUG -c input.c
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:43"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_170
#AT_START_171
# 171. regression.at:53: YYSTYPE typedef
at_setup_line='regression.at:53'
at_fn_banner 16
at_desc="YYSTYPE typedef"
at_desc_line="171: $at_desc                                "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "171. regression.at:53: testing ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%{
void yyerror (char const *);
int yylex (void);
typedef union { char const *val; } YYSTYPE;
%}

%type <val> program

%%

program: { $$ = ""; };
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/regression.at:69: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:69"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:69"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:69: bison --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_trace "regression.at:69"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:69"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:69: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:69"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:69"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/regression.at:69: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:69"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:69"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/regression.at:69: bison -o input.c input.y"
at_fn_check_prepare_trace "regression.at:69"
( $at_check_trace; bison -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:69"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:70: \$CC \$CFLAGS \$CPPFLAGS -o input.o -c input.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -o input.o -c input.c" "regression.at:70"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -o input.o -c input.c
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:70"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_171
#AT_START_172
# 172. regression.at:81: Early token definitions with --yacc
at_setup_line='regression.at:81'
at_fn_banner 16
at_desc="Early token definitions with --yacc"
at_desc_line="172: $at_desc            "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "172. regression.at:81: testing ..."
  $at_traceon


# Found in GCJ: they expect the tokens to be defined before the user
# prologue, so that they can use the token definitions in it.

cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%{
void yyerror (const char *s);
int yylex (void);
%}

%union
{
  int val;
};
%{
#ifndef MY_TOKEN
# error "MY_TOKEN not defined."
#endif
%}
%token MY_TOKEN
%%
exp: MY_TOKEN;
%%
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/regression.at:107: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -y -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:107"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -y -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:107"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:107: bison --xml=xml-tests/test.xml -y -o input.c input.y"
at_fn_check_prepare_trace "regression.at:107"
( $at_check_trace; bison --xml=xml-tests/test.xml -y -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:107"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:107: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:107"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:107"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/regression.at:107: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:107"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:107"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/regression.at:107: bison -y -o input.c input.y"
at_fn_check_prepare_trace "regression.at:107"
( $at_check_trace; bison -y -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:107"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:108: \$CC \$CFLAGS \$CPPFLAGS -o input.o -c input.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -o input.o -c input.c" "regression.at:108"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -o input.o -c input.c
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:108"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_172
#AT_START_173
# 173. regression.at:119: Early token definitions without --yacc
at_setup_line='regression.at:119'
at_fn_banner 16
at_desc="Early token definitions without --yacc"
at_desc_line="173: $at_desc         "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "173. regression.at:119: testing ..."
  $at_traceon


# Found in GCJ: they expect the tokens to be defined before the user
# prologue, so that they can use the token definitions in it.

cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%{
#include <stdio.h>
void yyerror (const char *s);
int yylex (void);
void print_my_token (void);
%}

%union
{
  int val;
};
%{
void
print_my_token (void)
{
  enum yytokentype my_token = MY_TOKEN;
  printf ("%d\n", my_token);
}
%}
%token MY_TOKEN
%%
exp: MY_TOKEN;
%%
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/regression.at:150: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:150"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:150"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:150: bison --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_trace "regression.at:150"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:150"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:150: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:150"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:150"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/regression.at:150: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:150"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:150"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/regression.at:150: bison -o input.c input.y"
at_fn_check_prepare_trace "regression.at:150"
( $at_check_trace; bison -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:150"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:151: \$CC \$CFLAGS \$CPPFLAGS -o input.o -c input.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -o input.o -c input.c" "regression.at:151"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -o input.o -c input.c
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:151"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_173
#AT_START_174
# 174. regression.at:162: Braces parsing
at_setup_line='regression.at:162'
at_fn_banner 16
at_desc="Braces parsing"
at_desc_line="174: $at_desc                                 "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "174. regression.at:162: testing ..."
  $at_traceon


cat >input.y <<'_ATEOF'
/* Bison used to swallow the character after `}'. */

%%
exp: { tests = {{{{{{{{{{}}}}}}}}}}; };
%%
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/regression.at:172: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -v -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:172"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -v -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:172"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:172: bison --xml=xml-tests/test.xml -v -o input.c input.y"
at_fn_check_prepare_trace "regression.at:172"
( $at_check_trace; bison --xml=xml-tests/test.xml -v -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:172"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:172: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:172"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:172"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/regression.at:172: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:172"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:172"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/regression.at:172: bison -v -o input.c input.y"
at_fn_check_prepare_trace "regression.at:172"
( $at_check_trace; bison -v -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:172"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/regression.at:174: grep 'tests = {{{{{{{{{{}}}}}}}}}};' input.c"
at_fn_check_prepare_trace "regression.at:174"
( $at_check_trace; grep 'tests = {{{{{{{{{{}}}}}}}}}};' input.c
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:174"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_174
#AT_START_175
# 175. regression.at:184: Duplicate string
at_setup_line='regression.at:184'
at_fn_banner 16
at_desc="Duplicate string"
at_desc_line="175: $at_desc                               "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "175. regression.at:184: testing ..."
  $at_traceon


cat >input.y <<'_ATEOF'
/* `Bison -v' used to dump core when two tokens are defined with the same
   string, as LE and GE below. */

%token NUM
%token LE "<="
%token GE "<="

%%
exp: '(' exp ')' | NUM ;
%%
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/regression.at:199: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -v -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:199"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -v -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:199"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:199: bison --xml=xml-tests/test.xml -v -o input.c input.y"
at_fn_check_prepare_trace "regression.at:199"
( $at_check_trace; bison --xml=xml-tests/test.xml -v -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:199"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:199: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:199"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:199"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/regression.at:199: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:199"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:199"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/regression.at:199: bison -v -o input.c input.y"
at_fn_check_prepare_trace "regression.at:199"
( $at_check_trace; bison -v -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:6.8-14: warning: symbol \`\"<=\"' used more than once as a literal string
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:199"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_175
#AT_START_176
# 176. regression.at:210: Rule Line Numbers
at_setup_line='regression.at:210'
at_fn_banner 16
at_desc="Rule Line Numbers"
at_desc_line="176: $at_desc                              "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "176. regression.at:210: testing ..."
  $at_traceon




cat >input.y <<'_ATEOF'
%%
expr:
'a'

{

}

'b'

{

}

|


{


}

'c'

{

};
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/regression.at:244: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c -v input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:244"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c -v input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:244"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:244: bison --xml=xml-tests/test.xml -o input.c -v input.y"
at_fn_check_prepare_trace "regression.at:244"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.c -v input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:244"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:244: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:244"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:244"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/regression.at:244: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:244"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:244"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/regression.at:244: bison -o input.c -v input.y"
at_fn_check_prepare_trace "regression.at:244"
( $at_check_trace; bison -o input.c -v input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:244"
$at_failed && at_fn_log_failure
$at_traceon; }


# Check the contents of the report.
{ set +x
$as_echo "$at_srcdir/regression.at:247: cat input.output"
at_fn_check_prepare_trace "regression.at:247"
( $at_check_trace; cat input.output
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "Grammar

    0 \$accept: expr \$end

    1 \$@1: /* empty */

    2 expr: 'a' \$@1 'b'

    3 \$@2: /* empty */

    4 expr: \$@2 'c'


Terminals, with rules where they appear

\$end (0) 0
'a' (97) 2
'b' (98) 2
'c' (99) 4
error (256)


Nonterminals, with rules where they appear

\$accept (6)
    on left: 0
expr (7)
    on left: 2 4, on right: 0
\$@1 (8)
    on left: 1, on right: 2
\$@2 (9)
    on left: 3, on right: 4


state 0

    0 \$accept: . expr \$end

    'a'  shift, and go to state 1

    \$default  reduce using rule 3 (\$@2)

    expr  go to state 2
    \$@2   go to state 3


state 1

    2 expr: 'a' . \$@1 'b'

    \$default  reduce using rule 1 (\$@1)

    \$@1  go to state 4


state 2

    0 \$accept: expr . \$end

    \$end  shift, and go to state 5


state 3

    4 expr: \$@2 . 'c'

    'c'  shift, and go to state 6


state 4

    2 expr: 'a' \$@1 . 'b'

    'b'  shift, and go to state 7


state 5

    0 \$accept: expr \$end .

    \$default  accept


state 6

    4 expr: \$@2 'c' .

    \$default  reduce using rule 4 (expr)


state 7

    2 expr: 'a' \$@1 'b' .

    \$default  reduce using rule 2 (expr)
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:247"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_176
#AT_START_177
# 177. regression.at:354: Mixing %token styles
at_setup_line='regression.at:354'
at_fn_banner 16
at_desc="Mixing %token styles"
at_desc_line="177: $at_desc                           "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "177. regression.at:354: testing ..."
  $at_traceon


# Taken from the documentation.
cat >input.y <<'_ATEOF'
%token  <operator>  OR      "||"
%token  <operator>  LE 134  "<="
%left  OR  "<="
%%
exp: ;
%%
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/regression.at:366: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -v -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:366"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -v -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:366"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:366: bison --xml=xml-tests/test.xml -v -o input.c input.y"
at_fn_check_prepare_trace "regression.at:366"
( $at_check_trace; bison --xml=xml-tests/test.xml -v -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:366"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:366: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:366"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:366"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/regression.at:366: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:366"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:366"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/regression.at:366: bison -v -o input.c input.y"
at_fn_check_prepare_trace "regression.at:366"
( $at_check_trace; bison -v -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:366"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_177
#AT_START_178
# 178. regression.at:377: Invalid inputs
at_setup_line='regression.at:377'
at_fn_banner 16
at_desc="Invalid inputs"
at_desc_line="178: $at_desc                                 "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "178. regression.at:377: testing ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%%
?
default: 'a' }
%&
%a-does-not-exist
%-
%{
_ATEOF



{ set +x
$as_echo "$at_srcdir/regression.at:389: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "regression.at:389"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:2.1: invalid character: \`?'
input.y:3.14: invalid character: \`}'
input.y:4.1: invalid character: \`%'
input.y:4.2: invalid character: \`&'
input.y:5.1-17: invalid directive: \`%a-does-not-exist'
input.y:6.1: invalid character: \`%'
input.y:6.2: invalid character: \`-'
input.y:7.1-8.0: missing \`%}' at end of file
input.y:7.1-8.0: syntax error, unexpected %{...%}
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/regression.at:389"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_178
#AT_START_179
# 179. regression.at:404: Invalid inputs with {}
at_setup_line='regression.at:404'
at_fn_banner 16
at_desc="Invalid inputs with {}"
at_desc_line="179: $at_desc                         "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "179. regression.at:404: testing ..."
  $at_traceon


cat >input.y <<'_ATEOF'

%destructor
%initial-action
%lex-param
%parse-param
%printer
%union
_ATEOF



{ set +x
$as_echo "$at_srcdir/regression.at:416: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison input.y" "regression.at:416"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:3.1-15: syntax error, unexpected %initial-action, expecting {...}
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/regression.at:416"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_179
#AT_START_180
# 180. regression.at:429: Token definitions
at_setup_line='regression.at:429'
at_fn_banner 16
at_desc="Token definitions"
at_desc_line="180: $at_desc                              "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "180. regression.at:429: testing ..."
  $at_traceon


# Bison managed, when fed with `%token 'f' "f"' to #define 'f'!
cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%{
#include <stdlib.h>
#include <stdio.h>
void yyerror (const char *s);
int yylex (void);
%}
%error-verbose
%token MYEOF 0 "end of file"
%token 'a' "a"
%token B_TOKEN "b"
%token C_TOKEN 'c'
%token 'd' D_TOKEN
%token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!"
%token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!"
%%
exp: "a" "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!";
%%
void
yyerror (char const *s)
{
  fprintf (stderr, "%s\n", s);
}

int
yylex (void)
{
  static int called;
  if (called++)
    abort ();
  return SPECIAL;
}

int
main (void)
{
  return yyparse ();
}
_ATEOF



# Checking the warning message guarantees that the trigraph "??!" isn't
# unnecessarily escaped here even though it would need to be if encoded in a
# C-string literal.  Also notice that unnecessary escaping, such as "\?", from
# the user specification is eliminated.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/regression.at:476: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:476"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:476"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:476: bison --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_trace "regression.at:476"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:476"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:476: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:476"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:476"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/regression.at:476: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:476"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:476"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/regression.at:476: bison -o input.c input.y"
at_fn_check_prepare_trace "regression.at:476"
( $at_check_trace; bison -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:22.8-14: warning: symbol SPECIAL redeclared
input.y:22.8-63: warning: symbol \`\"\\\\'?\\\"\\a\\b\\f\\n\\r\\t\\v\\001\\201\\001\\201??!\"' used more than once as a literal string
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:476"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:480: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "regression.at:480"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:480"
$at_failed && at_fn_log_failure
$at_traceon; }


# Checking the error message here guarantees that yytname, which does contain
# C-string literals, does have the trigraph escaped correctly.  Thus, the
# symbol name reported by the parser is exactly the same as that reported by
# Bison itself.
cat >experr <<'_ATEOF'
syntax error, unexpected "\\'?\"\a\b\f\n\r\t\v\001\201\001\201??!", expecting a
_ATEOF

{ set +x
$as_echo "$at_srcdir/regression.at:489:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:489"
( $at_check_trace;  $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/regression.at:489"
$at_failed && at_fn_log_failure
$at_traceon; }

  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_180
#AT_START_181
# 181. regression.at:499: Characters Escapes
at_setup_line='regression.at:499'
at_fn_banner 16
at_desc="Characters Escapes"
at_desc_line="181: $at_desc                             "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "181. regression.at:499: testing ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%{
void yyerror (const char *s);
int yylex (void);
%}
%%
exp:
  '\'' "\'"
| '\"' "\""
| '"'  "'"
;
_ATEOF


# Pacify font-lock-mode: "

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/regression.at:515: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:515"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:515"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:515: bison --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_trace "regression.at:515"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:515"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:515: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:515"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:515"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/regression.at:515: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:515"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:515"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/regression.at:515: bison -o input.c input.y"
at_fn_check_prepare_trace "regression.at:515"
( $at_check_trace; bison -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:515"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:516: \$CC \$CFLAGS \$CPPFLAGS -o input.o -c input.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -o input.o -c input.c" "regression.at:516"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -o input.o -c input.c
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:516"
$at_failed && at_fn_log_failure
$at_traceon; }

  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_181
#AT_START_182
# 182. regression.at:530: Web2c Report
at_setup_line='regression.at:530'
at_fn_banner 16
at_desc="Web2c Report"
at_desc_line="182: $at_desc                                   "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "182. regression.at:530: testing ..."
  $at_traceon




cat >input.y <<'_ATEOF'
%token	undef_id_tok const_id_tok

%start CONST_DEC_PART

%%
CONST_DEC_PART:
         CONST_DEC_LIST
        ;

CONST_DEC_LIST:
	  CONST_DEC
        | CONST_DEC_LIST CONST_DEC
        ;

CONST_DEC:
	  { } undef_id_tok '=' const_id_tok ';'
        ;
%%
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/regression.at:555: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -v input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:555"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -v input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:555"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:555: bison --xml=xml-tests/test.xml -v input.y"
at_fn_check_prepare_trace "regression.at:555"
( $at_check_trace; bison --xml=xml-tests/test.xml -v input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:555"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:555: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:555"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:555"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/regression.at:555: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:555"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:555"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/regression.at:555: bison -v input.y"
at_fn_check_prepare_trace "regression.at:555"
( $at_check_trace; bison -v input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:555"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:556: cat input.output"
at_fn_check_prepare_trace "regression.at:556"
( $at_check_trace; cat input.output
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "Grammar

    0 \$accept: CONST_DEC_PART \$end

    1 CONST_DEC_PART: CONST_DEC_LIST

    2 CONST_DEC_LIST: CONST_DEC
    3               | CONST_DEC_LIST CONST_DEC

    4 \$@1: /* empty */

    5 CONST_DEC: \$@1 undef_id_tok '=' const_id_tok ';'


Terminals, with rules where they appear

\$end (0) 0
';' (59) 5
'=' (61) 5
error (256)
undef_id_tok (258) 5
const_id_tok (259) 5


Nonterminals, with rules where they appear

\$accept (7)
    on left: 0
CONST_DEC_PART (8)
    on left: 1, on right: 0
CONST_DEC_LIST (9)
    on left: 2 3, on right: 1 3
CONST_DEC (10)
    on left: 5, on right: 2 3
\$@1 (11)
    on left: 4, on right: 5


state 0

    0 \$accept: . CONST_DEC_PART \$end

    \$default  reduce using rule 4 (\$@1)

    CONST_DEC_PART  go to state 1
    CONST_DEC_LIST  go to state 2
    CONST_DEC       go to state 3
    \$@1             go to state 4


state 1

    0 \$accept: CONST_DEC_PART . \$end

    \$end  shift, and go to state 5


state 2

    1 CONST_DEC_PART: CONST_DEC_LIST .
    3 CONST_DEC_LIST: CONST_DEC_LIST . CONST_DEC

    undef_id_tok  reduce using rule 4 (\$@1)
    \$default      reduce using rule 1 (CONST_DEC_PART)

    CONST_DEC  go to state 6
    \$@1        go to state 4


state 3

    2 CONST_DEC_LIST: CONST_DEC .

    \$default  reduce using rule 2 (CONST_DEC_LIST)


state 4

    5 CONST_DEC: \$@1 . undef_id_tok '=' const_id_tok ';'

    undef_id_tok  shift, and go to state 7


state 5

    0 \$accept: CONST_DEC_PART \$end .

    \$default  accept


state 6

    3 CONST_DEC_LIST: CONST_DEC_LIST CONST_DEC .

    \$default  reduce using rule 3 (CONST_DEC_LIST)


state 7

    5 CONST_DEC: \$@1 undef_id_tok . '=' const_id_tok ';'

    '='  shift, and go to state 8


state 8

    5 CONST_DEC: \$@1 undef_id_tok '=' . const_id_tok ';'

    const_id_tok  shift, and go to state 9


state 9

    5 CONST_DEC: \$@1 undef_id_tok '=' const_id_tok . ';'

    ';'  shift, and go to state 10


state 10

    5 CONST_DEC: \$@1 undef_id_tok '=' const_id_tok ';' .

    \$default  reduce using rule 5 (CONST_DEC)
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:556"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_182
#AT_START_183
# 183. regression.at:707: Web2c Actions
at_setup_line='regression.at:707'
at_fn_banner 16
at_desc="Web2c Actions"
at_desc_line="183: $at_desc                                  "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "183. regression.at:707: testing ..."
  $at_traceon




cat >input.y <<'_ATEOF'
%%
statement:  struct_stat;
struct_stat:  /* empty. */ | if else;
if: "if" "const" "then" statement;
else: "else" statement;
%%
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/regression.at:720: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -v -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:720"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -v -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:720"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:720: bison --xml=xml-tests/test.xml -v -o input.c input.y"
at_fn_check_prepare_trace "regression.at:720"
( $at_check_trace; bison --xml=xml-tests/test.xml -v -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:720"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:720: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:720"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:720"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/regression.at:720: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:720"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:720"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/regression.at:720: bison -v -o input.c input.y"
at_fn_check_prepare_trace "regression.at:720"
( $at_check_trace; bison -v -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:720"
$at_failed && at_fn_log_failure
$at_traceon; }


# Check only the tables.
sed -n 's/  *$//;/^static const.*\[\] =/,/^}/p' input.c >tables.c

{ set +x
$as_echo "$at_srcdir/regression.at:725: cat tables.c"
at_fn_check_prepare_trace "regression.at:725"
( $at_check_trace; cat tables.c
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "static const yytype_uint8 yytranslate[] =
{
       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
       5,     6
};
static const yytype_uint8 yyprhs[] =
{
       0,     0,     3,     5,     6,     9,    14
};
static const yytype_int8 yyrhs[] =
{
       8,     0,    -1,     9,    -1,    -1,    10,    11,    -1,     3,
       4,     5,     8,    -1,     6,     8,    -1
};
static const yytype_uint8 yyrline[] =
{
       0,     2,     2,     3,     3,     4,     5
};
static const char *const yytname[] =
{
  \"\$end\", \"error\", \"\$undefined\", \"\\\"if\\\"\", \"\\\"const\\\"\", \"\\\"then\\\"\",
  \"\\\"else\\\"\", \"\$accept\", \"statement\", \"struct_stat\", \"if\", \"else\", 0
};
static const yytype_uint16 yytoknum[] =
{
       0,   256,   257,   258,   259,   260,   261
};
static const yytype_uint8 yyr1[] =
{
       0,     7,     8,     9,     9,    10,    11
};
static const yytype_uint8 yyr2[] =
{
       0,     2,     1,     0,     2,     4,     2
};
static const yytype_uint8 yydefact[] =
{
       3,     0,     0,     2,     0,     0,     1,     3,     4,     3,
       6,     5
};
static const yytype_int8 yydefgoto[] =
{
      -1,     2,     3,     4,     8
};
static const yytype_int8 yypact[] =
{
      -2,    -1,     4,    -8,     0,     2,    -8,    -2,    -8,    -2,
      -8,    -8
};
static const yytype_int8 yypgoto[] =
{
      -8,    -7,    -8,    -8,    -8
};
static const yytype_uint8 yytable[] =
{
      10,     1,    11,     5,     6,     0,     7,     9
};
static const yytype_int8 yycheck[] =
{
       7,     3,     9,     4,     0,    -1,     6,     5
};
static const yytype_uint8 yystos[] =
{
       0,     3,     8,     9,    10,     4,     0,     6,    11,     5,
       8,     8
};
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:725"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_183
#AT_START_184
# 184. regression.at:953: Dancer
at_setup_line='regression.at:953'
at_fn_banner 16
at_desc="Dancer "
at_desc_line="184: $at_desc                                        "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "184. regression.at:953: testing ..."
  $at_traceon






# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.











cat >dancer.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%{
static int yylex (void);
#include <stdlib.h>
#include <stdio.h>
static void yyerror (const char *);
%}

%token ARROW INVALID NUMBER STRING DATA
%defines
%verbose
%error-verbose
/* Grammar follows */
%%
line: header body
   ;

header: '<' from ARROW to '>' type ':'
   | '<' ARROW to '>' type ':'
   | ARROW to type ':'
   | type ':'
   | '<' '>'
   ;

from: DATA
   | STRING
   | INVALID
   ;

to: DATA
   | STRING
   | INVALID
   ;

type: DATA
   | STRING
   | INVALID
   ;

body: /* empty */
   | body member
   ;

member: STRING
   | DATA
   | '+' NUMBER
   | '-' NUMBER
   | NUMBER
   | INVALID
   ;
%%
static void
yyerror (const char *s)
{
  fprintf (stderr, "%s\n", s);
}

static int
yylex (void)
{
  static int const tokens[] =
    {
      ':', -1
    };
  static size_t toknum;

  if (! (toknum < sizeof tokens / sizeof *tokens))
    abort ();
  return tokens[toknum++];
}

int
main (void)
{
  return yyparse ();
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/regression.at:953: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o dancer.c dancer.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:953"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o dancer.c dancer.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:953"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:953: bison --xml=xml-tests/test.xml -o dancer.c dancer.y"
at_fn_check_prepare_trace "regression.at:953"
( $at_check_trace; bison --xml=xml-tests/test.xml -o dancer.c dancer.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:953"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:953: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:953"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:953"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/regression.at:953: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:953"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:953"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/regression.at:953: bison -o dancer.c dancer.y"
at_fn_check_prepare_trace "regression.at:953"
( $at_check_trace; bison -o dancer.c dancer.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:953"
$at_failed && at_fn_log_failure
$at_traceon; }

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/regression.at:953: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o dancer.c dancer.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:953"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o dancer.c dancer.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:953"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:953: bison --xml=xml-tests/test.xml -o dancer.c dancer.y"
at_fn_check_prepare_trace "regression.at:953"
( $at_check_trace; bison --xml=xml-tests/test.xml -o dancer.c dancer.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:953"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:953: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:953"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:953"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/regression.at:953: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:953"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:953"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/regression.at:953: bison -o dancer.c dancer.y"
at_fn_check_prepare_trace "regression.at:953"
( $at_check_trace; bison -o dancer.c dancer.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:953"
$at_failed && at_fn_log_failure
$at_traceon; }

   { set +x
$as_echo "$at_srcdir/regression.at:953: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o dancer dancer.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o dancer dancer.c $LIBS" "regression.at:953"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o dancer dancer.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:953"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:953:  \$PREPARSER ./dancer"
at_fn_check_prepare_dynamic " $PREPARSER ./dancer" "regression.at:953"
( $at_check_trace;  $PREPARSER ./dancer
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "syntax error, unexpected ':'
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/regression.at:953"
$at_failed && at_fn_log_failure
$at_traceon; }
























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_184
#AT_START_185
# 185. regression.at:954: Dancer %glr-parser
at_setup_line='regression.at:954'
at_fn_banner 16
at_desc="Dancer %glr-parser"
at_desc_line="185: $at_desc                             "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "185. regression.at:954: testing ..."
  $at_traceon






# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.











cat >dancer.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%{
static int yylex (void);
#include <stdlib.h>
#include <stdio.h>
static void yyerror (const char *);
%}
%glr-parser
%token ARROW INVALID NUMBER STRING DATA
%defines
%verbose
%error-verbose
/* Grammar follows */
%%
line: header body
   ;

header: '<' from ARROW to '>' type ':'
   | '<' ARROW to '>' type ':'
   | ARROW to type ':'
   | type ':'
   | '<' '>'
   ;

from: DATA
   | STRING
   | INVALID
   ;

to: DATA
   | STRING
   | INVALID
   ;

type: DATA
   | STRING
   | INVALID
   ;

body: /* empty */
   | body member
   ;

member: STRING
   | DATA
   | '+' NUMBER
   | '-' NUMBER
   | NUMBER
   | INVALID
   ;
%%
static void
yyerror (const char *s)
{
  fprintf (stderr, "%s\n", s);
}

static int
yylex (void)
{
  static int const tokens[] =
    {
      ':', -1
    };
  static size_t toknum;

  if (! (toknum < sizeof tokens / sizeof *tokens))
    abort ();
  return tokens[toknum++];
}

int
main (void)
{
  return yyparse ();
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/regression.at:954: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o dancer.c dancer.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:954"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o dancer.c dancer.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:954"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:954: bison --xml=xml-tests/test.xml -o dancer.c dancer.y"
at_fn_check_prepare_trace "regression.at:954"
( $at_check_trace; bison --xml=xml-tests/test.xml -o dancer.c dancer.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:954"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:954: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:954"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:954"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/regression.at:954: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:954"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:954"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/regression.at:954: bison -o dancer.c dancer.y"
at_fn_check_prepare_trace "regression.at:954"
( $at_check_trace; bison -o dancer.c dancer.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:954"
$at_failed && at_fn_log_failure
$at_traceon; }

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/regression.at:954: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o dancer.c dancer.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:954"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o dancer.c dancer.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:954"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:954: bison --xml=xml-tests/test.xml -o dancer.c dancer.y"
at_fn_check_prepare_trace "regression.at:954"
( $at_check_trace; bison --xml=xml-tests/test.xml -o dancer.c dancer.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:954"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:954: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:954"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:954"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/regression.at:954: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:954"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:954"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/regression.at:954: bison -o dancer.c dancer.y"
at_fn_check_prepare_trace "regression.at:954"
( $at_check_trace; bison -o dancer.c dancer.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:954"
$at_failed && at_fn_log_failure
$at_traceon; }

   { set +x
$as_echo "$at_srcdir/regression.at:954: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o dancer dancer.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o dancer dancer.c $LIBS" "regression.at:954"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o dancer dancer.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:954"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:954:  \$PREPARSER ./dancer"
at_fn_check_prepare_dynamic " $PREPARSER ./dancer" "regression.at:954"
( $at_check_trace;  $PREPARSER ./dancer
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "syntax error, unexpected ':'
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/regression.at:954"
$at_failed && at_fn_log_failure
$at_traceon; }
























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_185
#AT_START_186
# 186. regression.at:955: Dancer %skeleton "lalr1.cc"
at_setup_line='regression.at:955'
at_fn_banner 16
at_desc="Dancer %skeleton \"lalr1.cc\""
at_desc_line="186: $at_desc                    "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "186. regression.at:955: testing ..."
  $at_traceon






# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.











cat >dancer.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%{
static int yylex (int *);

%}
%skeleton "lalr1.cc"
%token ARROW INVALID NUMBER STRING DATA
%defines
%verbose
%error-verbose
/* Grammar follows */
%%
line: header body
   ;

header: '<' from ARROW to '>' type ':'
   | '<' ARROW to '>' type ':'
   | ARROW to type ':'
   | type ':'
   | '<' '>'
   ;

from: DATA
   | STRING
   | INVALID
   ;

to: DATA
   | STRING
   | INVALID
   ;

type: DATA
   | STRING
   | INVALID
   ;

body: /* empty */
   | body member
   ;

member: STRING
   | DATA
   | '+' NUMBER
   | '-' NUMBER
   | NUMBER
   | INVALID
   ;
%%
/* A C++ error reporting function. */
void
yy::parser::error (const location&, const std::string& m)
{
  std::cerr << m << std::endl;
}

int
yyparse ()
{
  yy::parser parser;
#if YYDEBUG
  parser.set_debug_level (YYDEBUG);
#endif
  return parser.parse ();
}


static int
yylex (int *lval)
{
  static int const tokens[] =
    {
      ':', -1
    };
  static size_t toknum;
  *lval = 0; /* Pacify GCC.  */
  if (! (toknum < sizeof tokens / sizeof *tokens))
    abort ();
  return tokens[toknum++];
}

int
main (void)
{
  return yyparse ();
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/regression.at:955: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o dancer.c dancer.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:955"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o dancer.c dancer.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:955"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:955: bison --xml=xml-tests/test.xml -o dancer.c dancer.y"
at_fn_check_prepare_trace "regression.at:955"
( $at_check_trace; bison --xml=xml-tests/test.xml -o dancer.c dancer.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:955"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:955: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:955"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:955"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/regression.at:955: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:955"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:955"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/regression.at:955: bison -o dancer.c dancer.y"
at_fn_check_prepare_trace "regression.at:955"
( $at_check_trace; bison -o dancer.c dancer.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:955"
$at_failed && at_fn_log_failure
$at_traceon; }

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/regression.at:955: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o dancer.cc dancer.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:955"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o dancer.cc dancer.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:955"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:955: bison --xml=xml-tests/test.xml -o dancer.cc dancer.y"
at_fn_check_prepare_trace "regression.at:955"
( $at_check_trace; bison --xml=xml-tests/test.xml -o dancer.cc dancer.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:955"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:955: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:955"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:955"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/regression.at:955: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:955"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:955"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/regression.at:955: bison -o dancer.cc dancer.y"
at_fn_check_prepare_trace "regression.at:955"
( $at_check_trace; bison -o dancer.cc dancer.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:955"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/regression.at:955: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "regression.at:955"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:955"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:955: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o dancer dancer.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o dancer dancer.cc $LIBS" "regression.at:955"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o dancer dancer.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:955"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:955:  \$PREPARSER ./dancer"
at_fn_check_prepare_dynamic " $PREPARSER ./dancer" "regression.at:955"
( $at_check_trace;  $PREPARSER ./dancer
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "syntax error, unexpected ':'
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/regression.at:955"
$at_failed && at_fn_log_failure
$at_traceon; }
























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_186
#AT_START_187
# 187. regression.at:1053: Expecting two tokens
at_setup_line='regression.at:1053'
at_fn_banner 16
at_desc="Expecting two tokens "
at_desc_line="187: $at_desc                          "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "187. regression.at:1053: testing ..."
  $at_traceon






# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.











cat >expect2.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%{
static int yylex (void);
#include <stdio.h>
#include <stdlib.h>
static void yyerror (const char *);
%}

%defines
%error-verbose
%token A 1000
%token B

%%
program: /* empty */
 | program e ';'
 | program error ';';

e: e '+' t | t;
t: A | B;

%%
static void
yyerror (const char *s)
{
  fprintf (stderr, "%s\n", s);
}

static int
yylex (void)
{
  static int const tokens[] =
    {
      1000, '+', '+', -1
    };
  static size_t toknum;

  if (! (toknum < sizeof tokens / sizeof *tokens))
    abort ();
  return tokens[toknum++];
}

int
main (void)
{
  return yyparse ();
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/regression.at:1053: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o expect2.c expect2.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1053"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o expect2.c expect2.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1053"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:1053: bison --xml=xml-tests/test.xml -o expect2.c expect2.y"
at_fn_check_prepare_trace "regression.at:1053"
( $at_check_trace; bison --xml=xml-tests/test.xml -o expect2.c expect2.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1053"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:1053: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1053"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1053"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/regression.at:1053: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1053"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1053"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/regression.at:1053: bison -o expect2.c expect2.y"
at_fn_check_prepare_trace "regression.at:1053"
( $at_check_trace; bison -o expect2.c expect2.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1053"
$at_failed && at_fn_log_failure
$at_traceon; }

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/regression.at:1053: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o expect2.c expect2.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1053"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o expect2.c expect2.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1053"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:1053: bison --xml=xml-tests/test.xml -o expect2.c expect2.y"
at_fn_check_prepare_trace "regression.at:1053"
( $at_check_trace; bison --xml=xml-tests/test.xml -o expect2.c expect2.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1053"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:1053: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1053"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1053"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/regression.at:1053: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1053"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1053"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/regression.at:1053: bison -o expect2.c expect2.y"
at_fn_check_prepare_trace "regression.at:1053"
( $at_check_trace; bison -o expect2.c expect2.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1053"
$at_failed && at_fn_log_failure
$at_traceon; }

   { set +x
$as_echo "$at_srcdir/regression.at:1053: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o expect2 expect2.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o expect2 expect2.c $LIBS" "regression.at:1053"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o expect2 expect2.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1053"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1053:  \$PREPARSER ./expect2"
at_fn_check_prepare_dynamic " $PREPARSER ./expect2" "regression.at:1053"
( $at_check_trace;  $PREPARSER ./expect2
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "syntax error, unexpected '+', expecting A or B
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1053"
$at_failed && at_fn_log_failure
$at_traceon; }
























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_187
#AT_START_188
# 188. regression.at:1054: Expecting two tokens %glr-parser
at_setup_line='regression.at:1054'
at_fn_banner 16
at_desc="Expecting two tokens %glr-parser"
at_desc_line="188: $at_desc               "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "188. regression.at:1054: testing ..."
  $at_traceon






# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.











cat >expect2.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%{
static int yylex (void);
#include <stdio.h>
#include <stdlib.h>
static void yyerror (const char *);
%}
%glr-parser
%defines
%error-verbose
%token A 1000
%token B

%%
program: /* empty */
 | program e ';'
 | program error ';';

e: e '+' t | t;
t: A | B;

%%
static void
yyerror (const char *s)
{
  fprintf (stderr, "%s\n", s);
}

static int
yylex (void)
{
  static int const tokens[] =
    {
      1000, '+', '+', -1
    };
  static size_t toknum;

  if (! (toknum < sizeof tokens / sizeof *tokens))
    abort ();
  return tokens[toknum++];
}

int
main (void)
{
  return yyparse ();
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/regression.at:1054: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o expect2.c expect2.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1054"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o expect2.c expect2.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1054"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:1054: bison --xml=xml-tests/test.xml -o expect2.c expect2.y"
at_fn_check_prepare_trace "regression.at:1054"
( $at_check_trace; bison --xml=xml-tests/test.xml -o expect2.c expect2.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1054"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:1054: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1054"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1054"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/regression.at:1054: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1054"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1054"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/regression.at:1054: bison -o expect2.c expect2.y"
at_fn_check_prepare_trace "regression.at:1054"
( $at_check_trace; bison -o expect2.c expect2.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1054"
$at_failed && at_fn_log_failure
$at_traceon; }

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/regression.at:1054: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o expect2.c expect2.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1054"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o expect2.c expect2.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1054"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:1054: bison --xml=xml-tests/test.xml -o expect2.c expect2.y"
at_fn_check_prepare_trace "regression.at:1054"
( $at_check_trace; bison --xml=xml-tests/test.xml -o expect2.c expect2.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1054"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:1054: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1054"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1054"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/regression.at:1054: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1054"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1054"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/regression.at:1054: bison -o expect2.c expect2.y"
at_fn_check_prepare_trace "regression.at:1054"
( $at_check_trace; bison -o expect2.c expect2.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1054"
$at_failed && at_fn_log_failure
$at_traceon; }

   { set +x
$as_echo "$at_srcdir/regression.at:1054: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o expect2 expect2.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o expect2 expect2.c $LIBS" "regression.at:1054"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o expect2 expect2.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1054"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1054:  \$PREPARSER ./expect2"
at_fn_check_prepare_dynamic " $PREPARSER ./expect2" "regression.at:1054"
( $at_check_trace;  $PREPARSER ./expect2
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "syntax error, unexpected '+', expecting A or B
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1054"
$at_failed && at_fn_log_failure
$at_traceon; }
























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_188
#AT_START_189
# 189. regression.at:1055: Expecting two tokens %skeleton "lalr1.cc"
at_setup_line='regression.at:1055'
at_fn_banner 16
at_desc="Expecting two tokens %skeleton \"lalr1.cc\""
at_desc_line="189: $at_desc      "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "189. regression.at:1055: testing ..."
  $at_traceon






# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.











cat >expect2.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%{
static int yylex (int *);

%}
%skeleton "lalr1.cc"
%defines
%error-verbose
%token A 1000
%token B

%%
program: /* empty */
 | program e ';'
 | program error ';';

e: e '+' t | t;
t: A | B;

%%
/* A C++ error reporting function. */
void
yy::parser::error (const location&, const std::string& m)
{
  std::cerr << m << std::endl;
}

int
yyparse ()
{
  yy::parser parser;
  return parser.parse ();
}


static int
yylex (int *lval)
{
  static int const tokens[] =
    {
      1000, '+', '+', -1
    };
  static size_t toknum;
  *lval = 0; /* Pacify GCC.  */
  if (! (toknum < sizeof tokens / sizeof *tokens))
    abort ();
  return tokens[toknum++];
}

int
main (void)
{
  return yyparse ();
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/regression.at:1055: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o expect2.c expect2.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1055"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o expect2.c expect2.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1055"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:1055: bison --xml=xml-tests/test.xml -o expect2.c expect2.y"
at_fn_check_prepare_trace "regression.at:1055"
( $at_check_trace; bison --xml=xml-tests/test.xml -o expect2.c expect2.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1055"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:1055: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1055"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1055"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/regression.at:1055: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1055"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1055"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/regression.at:1055: bison -o expect2.c expect2.y"
at_fn_check_prepare_trace "regression.at:1055"
( $at_check_trace; bison -o expect2.c expect2.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1055"
$at_failed && at_fn_log_failure
$at_traceon; }

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/regression.at:1055: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o expect2.cc expect2.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1055"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o expect2.cc expect2.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1055"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:1055: bison --xml=xml-tests/test.xml -o expect2.cc expect2.y"
at_fn_check_prepare_trace "regression.at:1055"
( $at_check_trace; bison --xml=xml-tests/test.xml -o expect2.cc expect2.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1055"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:1055: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1055"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1055"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/regression.at:1055: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1055"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1055"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/regression.at:1055: bison -o expect2.cc expect2.y"
at_fn_check_prepare_trace "regression.at:1055"
( $at_check_trace; bison -o expect2.cc expect2.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1055"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/regression.at:1055: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "regression.at:1055"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1055"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1055: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o expect2 expect2.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o expect2 expect2.cc $LIBS" "regression.at:1055"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o expect2 expect2.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1055"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1055:  \$PREPARSER ./expect2"
at_fn_check_prepare_dynamic " $PREPARSER ./expect2" "regression.at:1055"
( $at_check_trace;  $PREPARSER ./expect2
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "syntax error, unexpected '+', expecting A or B
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1055"
$at_failed && at_fn_log_failure
$at_traceon; }
























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_189
#AT_START_190
# 190. regression.at:1063: Braced code in declaration in rules section
at_setup_line='regression.at:1063'
at_fn_banner 16
at_desc="Braced code in declaration in rules section"
at_desc_line="190: $at_desc    "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "190. regression.at:1063: testing ..."
  $at_traceon


# Bison once mistook braced code in a declaration in the rules section to be a
# rule action.

cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%{
#include <stdio.h>
static void yyerror (char const *msg);
static int yylex (void);
%}

%error-verbose

%%

start:
  {
    printf ("Bison would once convert this action to a midrule because of the"
	    " subsequent braced code.\n");
  }
  ;

%destructor { fprintf (stderr, "DESTRUCTOR\n"); } 'a';
%printer { fprintf (yyoutput, "PRINTER"); } 'a';

%%

static void
yyerror (char const *msg)
{
  fprintf (stderr, "%s\n", msg);
}

static int
yylex (void)
{
  return 'a';
}

int
main (void)
{
  yydebug = 1;
  return !yyparse ();
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/regression.at:1111: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -t -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1111"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -t -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1111"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:1111: bison --xml=xml-tests/test.xml -t -o input.c input.y"
at_fn_check_prepare_trace "regression.at:1111"
( $at_check_trace; bison --xml=xml-tests/test.xml -t -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1111"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:1111: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1111"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1111"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/regression.at:1111: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1111"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1111"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/regression.at:1111: bison -t -o input.c input.y"
at_fn_check_prepare_trace "regression.at:1111"
( $at_check_trace; bison -t -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1111"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1112: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "regression.at:1112"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1112"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1113:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1113"
( $at_check_trace;  $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "Starting parse
Entering state 0
Reducing stack by rule 1 (line 20):
-> \$\$ = nterm start ()
Stack now 0
Entering state 1
Reading a token: Next token is token 'a' (PRINTER)
syntax error, unexpected 'a', expecting \$end
Error: popping nterm start ()
Stack now 0
Cleanup: discarding lookahead token 'a' (PRINTER)
DESTRUCTOR
Stack now 0
" | \
  $at_diff - "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "Bison would once convert this action to a midrule because of the subsequent braced code.
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1113"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_190
#AT_START_191
# 191. regression.at:1139: String alias declared after use
at_setup_line='regression.at:1139'
at_fn_banner 16
at_desc="String alias declared after use"
at_desc_line="191: $at_desc                "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "191. regression.at:1139: testing ..."
  $at_traceon


# Bison once incorrectly asserted that the symbol number for either a token or
# its alias was the highest symbol number so far at the point of the alias
# declaration.  That was true unless the declaration appeared after their first
# uses and other tokens appeared in between.

cat >input.y <<'_ATEOF'
%%
start: 'a' "A" 'b';
%token 'a' "A";
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/regression.at:1152: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -t -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1152"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -t -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1152"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:1152: bison --xml=xml-tests/test.xml -t -o input.c input.y"
at_fn_check_prepare_trace "regression.at:1152"
( $at_check_trace; bison --xml=xml-tests/test.xml -t -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1152"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:1152: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1152"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1152"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/regression.at:1152: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1152"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1152"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/regression.at:1152: bison -t -o input.c input.y"
at_fn_check_prepare_trace "regression.at:1152"
( $at_check_trace; bison -t -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1152"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_191
#AT_START_192
# 192. regression.at:1162: Extra lookahead sets in report
at_setup_line='regression.at:1162'
at_fn_banner 16
at_desc="Extra lookahead sets in report"
at_desc_line="192: $at_desc                 "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "192. regression.at:1162: testing ..."
  $at_traceon


# Bison prints each reduction's lookahead set only next to the associated
# state's one item that (1) is associated with the same rule as the reduction
# and (2) has its dot at the end of its RHS.  Previously, Bison also
# erroneously printed the lookahead set next to all of the state's other items
# associated with the same rule.  This bug affected only the `.output' file and
# not the generated parser source code.

cat >input.y <<'_ATEOF'
%%
start: a | 'a' a 'a' ;
a: 'a' ;
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/regression.at:1177: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot --report=all input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1177"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot --report=all input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1177"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:1177: bison --xml=xml-tests/test.xml --report=all input.y"
at_fn_check_prepare_trace "regression.at:1177"
( $at_check_trace; bison --xml=xml-tests/test.xml --report=all input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1177"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:1177: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1177"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1177"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/regression.at:1177: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1177"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1177"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/regression.at:1177: bison --report=all input.y"
at_fn_check_prepare_trace "regression.at:1177"
( $at_check_trace; bison --report=all input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1177"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1178: sed -n '/^state 1\$/,/^state 2\$/p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^state 1$/,/^state 2$/p' input.output" "regression.at:1178"
( $at_check_trace; sed -n '/^state 1$/,/^state 2$/p' input.output
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "state 1

    2 start: 'a' . a 'a'
    3 a: . 'a'
    3  | 'a' .  [\$end]

    'a'  shift, and go to state 4

    \$default  reduce using rule 3 (a)

    a  go to state 5


state 2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1178"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_192
#AT_START_193
# 193. regression.at:1203: Token number in precedence declaration
at_setup_line='regression.at:1203'
at_fn_banner 16
at_desc="Token number in precedence declaration"
at_desc_line="193: $at_desc         "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "193. regression.at:1203: testing ..."
  $at_traceon


# POSIX says token numbers can be declared in %left, %right, and %nonassoc, but
# we lost this in Bison 1.50.

cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%{
  #include <stdio.h>
  void yyerror (char const *);
  int yylex (void);
%}

%error-verbose
%left TK1 1 TK2 2 "tok alias" 3

%%

start: TK1 sr_conflict "tok alias" ;

sr_conflict:
  TK2
  | TK2 "tok alias"
  ;

%%

void
yyerror (char const *msg)
{
  fprintf (stderr, "%s\n", msg);
}

int
yylex (void)
{
  static int const input[] = { 1, 2, 3, 0 };
  static int const *inputp = input;
  return *inputp++;
}

int
main (void)
{
  return yyparse ();
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/regression.at:1250: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1250"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1250"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:1250: bison --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_trace "regression.at:1250"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1250"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:1250: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1250"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1250"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/regression.at:1250: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1250"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1250"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/regression.at:1250: bison -o input.c input.y"
at_fn_check_prepare_trace "regression.at:1250"
( $at_check_trace; bison -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:24.5-19: warning: rule useless in parser due to conflicts: sr_conflict: TK2 \"tok alias\"
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1250"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1253: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "regression.at:1253"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1253"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1254:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1254"
( $at_check_trace;  $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1254"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_193
#AT_START_194
# 194. regression.at:1264: Fix user actions without a trailing semicolon
at_setup_line='regression.at:1264'
at_fn_banner 16
at_desc="Fix user actions without a trailing semicolon"
at_desc_line="194: $at_desc  "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "194. regression.at:1264: testing ..."
  $at_traceon


# This feature is undocumented, but we accidentally broke it in 2.3a, and there
# was a complaint at:
# <http://lists.gnu.org/archive/html/bug-bison/2008-11/msg00001.html>.

cat >input.y <<'_ATEOF'
%%
start: {asdffdsa} ;
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/regression.at:1275: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1275"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1275"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/regression.at:1275: bison --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_trace "regression.at:1275"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1275"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/regression.at:1275: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1275"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1275"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/regression.at:1275: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "regression.at:1275"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1275"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/regression.at:1275: bison -o input.c input.y"
at_fn_check_prepare_trace "regression.at:1275"
( $at_check_trace; bison -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1275"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/regression.at:1276: sed -n '/asdffdsa/s/^ *//p' input.c"
at_fn_check_prepare_trace "regression.at:1276"
( $at_check_trace; sed -n '/asdffdsa/s/^ *//p' input.c
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "{asdffdsa;}
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1276"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_194
#AT_START_195
# 195. c++.at:101: Doxygen Public Documentation
at_setup_line='c++.at:101'
at_fn_banner 17
at_desc="Doxygen Public Documentation"
at_desc_line="195: $at_desc                   "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "195. c++.at:101: testing ..."
  $at_traceon


cat >input.yy <<'_ATEOF'
%skeleton "lalr1.cc"
%locations
%debug
%defines
%%
exp:;
%%
yy::parser::error (const location& l, const std::string& m)
{
  std::cerr << l << s << std::endl;
}
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/c++.at:101: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.yy"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:101"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.cc input.yy
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:101"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:101: bison --xml=xml-tests/test.xml -o input.cc input.yy"
at_fn_check_prepare_trace "c++.at:101"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.cc input.yy
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:101"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:101: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:101"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:101"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/c++.at:101: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:101"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:101"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/c++.at:101: bison -o input.cc input.yy"
at_fn_check_prepare_trace "c++.at:101"
( $at_check_trace; bison -o input.cc input.yy
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:101"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >Doxyfile <<'_ATEOF'
# The PROJECT_NAME tag is a single word (or a sequence of words
# surrounded by quotes) that should identify the project.
PROJECT_NAME = "Bison C++ Parser"

# The QUIET tag can be used to turn on/off the messages that are
# generated by doxygen. Possible values are YES and NO. If left blank
# NO is used.
QUIET = YES

# The WARNINGS tag can be used to turn on/off the warning messages
# that are generated by doxygen. Possible values are YES and NO. If
# left blank NO is used.
WARNINGS     = YES
# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate
# warnings for undocumented members. If EXTRACT_ALL is set to YES then
# this flag will automatically be disabled.
WARN_IF_UNDOCUMENTED   = YES
# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings
# for potential errors in the documentation, such as not documenting
# some parameters in a documented function, or documenting parameters
# that don't exist or using markup commands wrongly.
WARN_IF_DOC_ERROR      = YES
# The WARN_FORMAT tag determines the format of the warning messages
# that doxygen can produce. The string should contain the $file,
# $line, and $text tags, which will be replaced by the file and line
# number from which the warning originated and the warning text.
WARN_FORMAT            = "$file:$line: $text"

# If the EXTRACT_ALL tag is set to YES doxygen will assume all
# entities in documentation are documented, even if no documentation
# was available.  Private class members and static file members will
# be hidden unless the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set
# to YES
EXTRACT_ALL            = YES

# If the EXTRACT_PRIVATE tag is set to YES all private members of a
# class will be included in the documentation.
EXTRACT_PRIVATE        = NO

# If the EXTRACT_STATIC tag is set to YES all static members of a file
# will be included in the documentation.
EXTRACT_STATIC         = NO
_ATEOF


{ set +x
$as_echo "$at_srcdir/c++.at:101: doxygen --version || exit 77"
at_fn_check_prepare_trace "c++.at:101"
( $at_check_trace; doxygen --version || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:101"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:101: doxygen"
at_fn_check_prepare_trace "c++.at:101"
( $at_check_trace; doxygen
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:101"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_195
#AT_START_196
# 196. c++.at:102: Doxygen Private Documentation
at_setup_line='c++.at:102'
at_fn_banner 17
at_desc="Doxygen Private Documentation"
at_desc_line="196: $at_desc                  "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "196. c++.at:102: testing ..."
  $at_traceon


cat >input.yy <<'_ATEOF'
%skeleton "lalr1.cc"
%locations
%debug
%defines
%%
exp:;
%%
yy::parser::error (const location& l, const std::string& m)
{
  std::cerr << l << s << std::endl;
}
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/c++.at:102: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.yy"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:102"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.cc input.yy
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:102"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:102: bison --xml=xml-tests/test.xml -o input.cc input.yy"
at_fn_check_prepare_trace "c++.at:102"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.cc input.yy
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:102"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:102: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:102"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:102"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/c++.at:102: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:102"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:102"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/c++.at:102: bison -o input.cc input.yy"
at_fn_check_prepare_trace "c++.at:102"
( $at_check_trace; bison -o input.cc input.yy
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:102"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >Doxyfile <<'_ATEOF'
# The PROJECT_NAME tag is a single word (or a sequence of words
# surrounded by quotes) that should identify the project.
PROJECT_NAME = "Bison C++ Parser"

# The QUIET tag can be used to turn on/off the messages that are
# generated by doxygen. Possible values are YES and NO. If left blank
# NO is used.
QUIET = YES

# The WARNINGS tag can be used to turn on/off the warning messages
# that are generated by doxygen. Possible values are YES and NO. If
# left blank NO is used.
WARNINGS     = YES
# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate
# warnings for undocumented members. If EXTRACT_ALL is set to YES then
# this flag will automatically be disabled.
WARN_IF_UNDOCUMENTED   = YES
# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings
# for potential errors in the documentation, such as not documenting
# some parameters in a documented function, or documenting parameters
# that don't exist or using markup commands wrongly.
WARN_IF_DOC_ERROR      = YES
# The WARN_FORMAT tag determines the format of the warning messages
# that doxygen can produce. The string should contain the $file,
# $line, and $text tags, which will be replaced by the file and line
# number from which the warning originated and the warning text.
WARN_FORMAT            = "$file:$line: $text"

# If the EXTRACT_ALL tag is set to YES doxygen will assume all
# entities in documentation are documented, even if no documentation
# was available.  Private class members and static file members will
# be hidden unless the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set
# to YES
EXTRACT_ALL            = YES

# If the EXTRACT_PRIVATE tag is set to YES all private members of a
# class will be included in the documentation.
EXTRACT_PRIVATE        = YES

# If the EXTRACT_STATIC tag is set to YES all static members of a file
# will be included in the documentation.
EXTRACT_STATIC         = YES
_ATEOF


{ set +x
$as_echo "$at_srcdir/c++.at:102: doxygen --version || exit 77"
at_fn_check_prepare_trace "c++.at:102"
( $at_check_trace; doxygen --version || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:102"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:102: doxygen"
at_fn_check_prepare_trace "c++.at:102"
( $at_check_trace; doxygen
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:102"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_196
#AT_START_197
# 197. c++.at:160: Relative namespace references
at_setup_line='c++.at:160'
at_fn_banner 17
at_desc="Relative namespace references"
at_desc_line="197: $at_desc                  "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "197. c++.at:160: testing ..."
  $at_traceon



cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%language "C++"
%defines
%define namespace "foo"
%union { int i; }
%define global_tokens_and_yystype

%code {
  // YYSTYPE contains a namespace reference.
  int yylex (YYSTYPE *lval) {
    lval->i = 3;
    return 0;
  }
}

%%

start: ;

%%

void
foo::parser::error (const foo::parser::location_type &loc,
                     const std::string &msg)
{
  std::cerr << "At " << loc << ": " << msg << std::endl;
}

int
main (void)
{
  foo::parser p;
  return p.parse ();
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/c++.at:161: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:161"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:161"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:161: bison --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_trace "c++.at:161"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:161"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:161: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:161"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:161"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/c++.at:161: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:161"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:161"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/c++.at:161: bison -o input.cc input.y"
at_fn_check_prepare_trace "c++.at:161"
( $at_check_trace; bison -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:161"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:161: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:161"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:161"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:161: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "c++.at:161"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:161"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:161:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:161"
( $at_check_trace;  $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:161"
$at_failed && at_fn_log_failure
$at_traceon; }





cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%language "C++"
%defines
%define namespace "foo::bar"
%union { int i; }
%define global_tokens_and_yystype

%code {
  // YYSTYPE contains a namespace reference.
  int yylex (YYSTYPE *lval) {
    lval->i = 3;
    return 0;
  }
}

%%

start: ;

%%

void
foo::bar::parser::error (const foo::bar::parser::location_type &loc,
                     const std::string &msg)
{
  std::cerr << "At " << loc << ": " << msg << std::endl;
}

int
main (void)
{
  foo::bar::parser p;
  return p.parse ();
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/c++.at:162: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:162"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:162"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:162: bison --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_trace "c++.at:162"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:162"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:162: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:162"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:162"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/c++.at:162: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:162"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:162"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/c++.at:162: bison -o input.cc input.y"
at_fn_check_prepare_trace "c++.at:162"
( $at_check_trace; bison -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:162"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:162: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:162"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:162"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:162: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "c++.at:162"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:162"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:162:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:162"
( $at_check_trace;  $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:162"
$at_failed && at_fn_log_failure
$at_traceon; }





cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%language "C++"
%defines
%define namespace "foo::bar::baz"
%union { int i; }
%define global_tokens_and_yystype

%code {
  // YYSTYPE contains a namespace reference.
  int yylex (YYSTYPE *lval) {
    lval->i = 3;
    return 0;
  }
}

%%

start: ;

%%

void
foo::bar::baz::parser::error (const foo::bar::baz::parser::location_type &loc,
                     const std::string &msg)
{
  std::cerr << "At " << loc << ": " << msg << std::endl;
}

int
main (void)
{
  foo::bar::baz::parser p;
  return p.parse ();
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/c++.at:163: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:163"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:163"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:163: bison --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_trace "c++.at:163"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:163"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:163: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:163"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:163"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/c++.at:163: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:163"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:163"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/c++.at:163: bison -o input.cc input.y"
at_fn_check_prepare_trace "c++.at:163"
( $at_check_trace; bison -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:163"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:163: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:163"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:163"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:163: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "c++.at:163"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:163"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:163:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:163"
( $at_check_trace;  $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:163"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_197
#AT_START_198
# 198. c++.at:166: Absolute namespace references
at_setup_line='c++.at:166'
at_fn_banner 17
at_desc="Absolute namespace references"
at_desc_line="198: $at_desc                  "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "198. c++.at:166: testing ..."
  $at_traceon



cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%language "C++"
%defines
%define namespace "::foo"
%union { int i; }
%define global_tokens_and_yystype

%code {
  // YYSTYPE contains a namespace reference.
  int yylex (YYSTYPE *lval) {
    lval->i = 3;
    return 0;
  }
}

%%

start: ;

%%

void
::foo::parser::error (const ::foo::parser::location_type &loc,
                     const std::string &msg)
{
  std::cerr << "At " << loc << ": " << msg << std::endl;
}

int
main (void)
{
  ::foo::parser p;
  return p.parse ();
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/c++.at:167: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:167"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:167"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:167: bison --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_trace "c++.at:167"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:167"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:167: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:167"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:167"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/c++.at:167: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:167"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:167"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/c++.at:167: bison -o input.cc input.y"
at_fn_check_prepare_trace "c++.at:167"
( $at_check_trace; bison -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:167"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:167: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:167"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:167"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:167: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "c++.at:167"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:167"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:167:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:167"
( $at_check_trace;  $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:167"
$at_failed && at_fn_log_failure
$at_traceon; }





cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%language "C++"
%defines
%define namespace "::foo::bar"
%union { int i; }
%define global_tokens_and_yystype

%code {
  // YYSTYPE contains a namespace reference.
  int yylex (YYSTYPE *lval) {
    lval->i = 3;
    return 0;
  }
}

%%

start: ;

%%

void
::foo::bar::parser::error (const ::foo::bar::parser::location_type &loc,
                     const std::string &msg)
{
  std::cerr << "At " << loc << ": " << msg << std::endl;
}

int
main (void)
{
  ::foo::bar::parser p;
  return p.parse ();
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/c++.at:168: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:168"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:168"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:168: bison --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_trace "c++.at:168"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:168"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:168: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:168"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:168"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/c++.at:168: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:168"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:168"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/c++.at:168: bison -o input.cc input.y"
at_fn_check_prepare_trace "c++.at:168"
( $at_check_trace; bison -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:168"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:168: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:168"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:168"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:168: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "c++.at:168"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:168"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:168:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:168"
( $at_check_trace;  $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:168"
$at_failed && at_fn_log_failure
$at_traceon; }





cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%language "C++"
%defines
%define namespace "::foo::bar::baz"
%union { int i; }
%define global_tokens_and_yystype

%code {
  // YYSTYPE contains a namespace reference.
  int yylex (YYSTYPE *lval) {
    lval->i = 3;
    return 0;
  }
}

%%

start: ;

%%

void
::foo::bar::baz::parser::error (const ::foo::bar::baz::parser::location_type &loc,
                     const std::string &msg)
{
  std::cerr << "At " << loc << ": " << msg << std::endl;
}

int
main (void)
{
  ::foo::bar::baz::parser p;
  return p.parse ();
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/c++.at:169: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:169"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:169"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:169: bison --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_trace "c++.at:169"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:169"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:169: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:169"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:169"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/c++.at:169: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:169"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:169"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/c++.at:169: bison -o input.cc input.y"
at_fn_check_prepare_trace "c++.at:169"
( $at_check_trace; bison -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:169"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:169: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:169"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:169"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:169: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "c++.at:169"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:169"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:169:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:169"
( $at_check_trace;  $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:169"
$at_failed && at_fn_log_failure
$at_traceon; }





cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%language "C++"
%defines
%define namespace "	::foo"
%union { int i; }
%define global_tokens_and_yystype

%code {
  // YYSTYPE contains a namespace reference.
  int yylex (YYSTYPE *lval) {
    lval->i = 3;
    return 0;
  }
}

%%

start: ;

%%

void
	::foo::parser::error (const 	::foo::parser::location_type &loc,
                     const std::string &msg)
{
  std::cerr << "At " << loc << ": " << msg << std::endl;
}

int
main (void)
{
  	::foo::parser p;
  return p.parse ();
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/c++.at:170: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:170"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:170"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:170: bison --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_trace "c++.at:170"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:170"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:170: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:170"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:170"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/c++.at:170: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:170"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:170"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/c++.at:170: bison -o input.cc input.y"
at_fn_check_prepare_trace "c++.at:170"
( $at_check_trace; bison -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:170"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:170: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:170"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:170"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:170: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "c++.at:170"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:170"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:170:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:170"
( $at_check_trace;  $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:170"
$at_failed && at_fn_log_failure
$at_traceon; }





cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%language "C++"
%defines
%define namespace "  	 ::foo::bar"
%union { int i; }
%define global_tokens_and_yystype

%code {
  // YYSTYPE contains a namespace reference.
  int yylex (YYSTYPE *lval) {
    lval->i = 3;
    return 0;
  }
}

%%

start: ;

%%

void
  	 ::foo::bar::parser::error (const   	 ::foo::bar::parser::location_type &loc,
                     const std::string &msg)
{
  std::cerr << "At " << loc << ": " << msg << std::endl;
}

int
main (void)
{
    	 ::foo::bar::parser p;
  return p.parse ();
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/c++.at:171: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:171"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:171"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:171: bison --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_trace "c++.at:171"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:171"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:171: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:171"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:171"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/c++.at:171: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:171"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:171"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/c++.at:171: bison -o input.cc input.y"
at_fn_check_prepare_trace "c++.at:171"
( $at_check_trace; bison -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:171"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:171: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:171"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:171"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:171: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "c++.at:171"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:171"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:171:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:171"
( $at_check_trace;  $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:171"
$at_failed && at_fn_log_failure
$at_traceon; }





cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%language "C++"
%defines
%define namespace "  ::foo::bar::baz"
%union { int i; }
%define global_tokens_and_yystype

%code {
  // YYSTYPE contains a namespace reference.
  int yylex (YYSTYPE *lval) {
    lval->i = 3;
    return 0;
  }
}

%%

start: ;

%%

void
  ::foo::bar::baz::parser::error (const   ::foo::bar::baz::parser::location_type &loc,
                     const std::string &msg)
{
  std::cerr << "At " << loc << ": " << msg << std::endl;
}

int
main (void)
{
    ::foo::bar::baz::parser p;
  return p.parse ();
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/c++.at:172: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:172"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:172"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:172: bison --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_trace "c++.at:172"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:172"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:172: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:172"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:172"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/c++.at:172: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:172"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:172"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/c++.at:172: bison -o input.cc input.y"
at_fn_check_prepare_trace "c++.at:172"
( $at_check_trace; bison -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:172"
$at_failed && at_fn_log_failure
$at_traceon; }



{ set +x
$as_echo "$at_srcdir/c++.at:172: \$BISON_CXX_WORKS"
at_fn_check_prepare_dynamic "$BISON_CXX_WORKS" "c++.at:172"
( $at_check_trace; $BISON_CXX_WORKS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:172"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:172: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "c++.at:172"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:172"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/c++.at:172:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:172"
( $at_check_trace;  $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:172"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_198
#AT_START_199
# 199. c++.at:175: Syntactically invalid namespace references
at_setup_line='c++.at:175'
at_fn_banner 17
at_desc="Syntactically invalid namespace references"
at_desc_line="199: $at_desc     "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "199. c++.at:175: testing ..."
  $at_traceon



cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%language "C++"
%defines
%define namespace ":foo:bar"
%union { int i; }
%define global_tokens_and_yystype

%code {
  // YYSTYPE contains a namespace reference.
  int yylex (YYSTYPE *lval) {
    lval->i = 3;
    return 0;
  }
}

%%

start: ;

%%

void
:foo:bar::parser::error (const :foo:bar::parser::location_type &loc,
                     const std::string &msg)
{
  std::cerr << "At " << loc << ": " << msg << std::endl;
}

int
main (void)
{
  :foo:bar::parser p;
  return p.parse ();
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/c++.at:176: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:176"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:176"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:176: bison --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_trace "c++.at:176"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:176"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:176: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:176"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:176"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/c++.at:176: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:176"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:176"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/c++.at:176: bison -o input.cc input.y"
at_fn_check_prepare_trace "c++.at:176"
( $at_check_trace; bison -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:176"
$at_failed && at_fn_log_failure
$at_traceon; }







cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%language "C++"
%defines
%define namespace "foo: :bar"
%union { int i; }
%define global_tokens_and_yystype

%code {
  // YYSTYPE contains a namespace reference.
  int yylex (YYSTYPE *lval) {
    lval->i = 3;
    return 0;
  }
}

%%

start: ;

%%

void
foo: :bar::parser::error (const foo: :bar::parser::location_type &loc,
                     const std::string &msg)
{
  std::cerr << "At " << loc << ": " << msg << std::endl;
}

int
main (void)
{
  foo: :bar::parser p;
  return p.parse ();
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/c++.at:177: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:177"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:177"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:177: bison --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_trace "c++.at:177"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:177"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:177: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:177"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:177"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/c++.at:177: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:177"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:177"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/c++.at:177: bison -o input.cc input.y"
at_fn_check_prepare_trace "c++.at:177"
( $at_check_trace; bison -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:177"
$at_failed && at_fn_log_failure
$at_traceon; }





# This one is interesting because `[3]' is encoded as `[3]', which
# contains single occurrences of `:'.


cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%language "C++"
%defines
%define namespace "foo[3]::bar::baz"
%union { int i; }
%define global_tokens_and_yystype

%code {
  // YYSTYPE contains a namespace reference.
  int yylex (YYSTYPE *lval) {
    lval->i = 3;
    return 0;
  }
}

%%

start: ;

%%

void
foo[3]::bar::baz::parser::error (const foo[3]::bar::baz::parser::location_type &loc,
                     const std::string &msg)
{
  std::cerr << "At " << loc << ": " << msg << std::endl;
}

int
main (void)
{
  foo[3]::bar::baz::parser p;
  return p.parse ();
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/c++.at:180: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:180"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:180"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:180: bison --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_trace "c++.at:180"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:180"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:180: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:180"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:180"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/c++.at:180: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:180"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:180"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/c++.at:180: bison -o input.cc input.y"
at_fn_check_prepare_trace "c++.at:180"
( $at_check_trace; bison -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:180"
$at_failed && at_fn_log_failure
$at_traceon; }







cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%language "C++"
%defines
%define namespace "foo::bar,baz"
%union { int i; }
%define global_tokens_and_yystype

%code {
  // YYSTYPE contains a namespace reference.
  int yylex (YYSTYPE *lval) {
    lval->i = 3;
    return 0;
  }
}

%%

start: ;

%%

void
foo::bar,baz::parser::error (const foo::bar,baz::parser::location_type &loc,
                     const std::string &msg)
{
  std::cerr << "At " << loc << ": " << msg << std::endl;
}

int
main (void)
{
  foo::bar,baz::parser p;
  return p.parse ();
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/c++.at:181: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:181"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:181"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:181: bison --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_trace "c++.at:181"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:181"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:181: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:181"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:181"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/c++.at:181: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:181"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:181"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/c++.at:181: bison -o input.cc input.y"
at_fn_check_prepare_trace "c++.at:181"
( $at_check_trace; bison -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:181"
$at_failed && at_fn_log_failure
$at_traceon; }







cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%language "C++"
%defines
%define namespace "foo::bar::(baz"
%union { int i; }
%define global_tokens_and_yystype

%code {
  // YYSTYPE contains a namespace reference.
  int yylex (YYSTYPE *lval) {
    lval->i = 3;
    return 0;
  }
}

%%

start: ;

%%

void
foo::bar::(baz::parser::error (const foo::bar::(baz::parser::location_type &loc,
                     const std::string &msg)
{
  std::cerr << "At " << loc << ": " << msg << std::endl;
}

int
main (void)
{
  foo::bar::(baz::parser p;
  return p.parse ();
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/c++.at:182: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "c++.at:182"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:182"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/c++.at:182: bison --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_trace "c++.at:182"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:182"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/c++.at:182: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:182"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:182"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/c++.at:182: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "c++.at:182"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:182"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/c++.at:182: bison -o input.cc input.y"
at_fn_check_prepare_trace "c++.at:182"
( $at_check_trace; bison -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/c++.at:182"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_199
#AT_START_200
# 200. java.at:385: Calculator
at_setup_line='java.at:385'
at_fn_banner 18
at_desc="Calculator "
at_desc_line="200: $at_desc                                    "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "200. java.at:385: testing ..."
  $at_traceon







# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.












cat >Calc.y <<'_ATEOF'
/* Infix notation calculator--calc */
%language "Java"
%name-prefix "Calc"
%define parser_class_name "Calc"
%define public


%code {

  public static void main (String args[]) throws IOException
  {
    CalcLexer l = new CalcLexer (System.in);
    Calc p = new Calc (l);
    p.parse ();
  }

}

%code imports {
  import java.io.StreamTokenizer;
  import java.io.InputStream;
  import java.io.InputStreamReader;
  import java.io.Reader;
  import java.io.IOException;
}

/* Bison Declarations */
%token <Integer> NUM "number"
%type  <Integer> exp

%nonassoc '=' /* comparison            */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line
;

line:
  '\n'
| exp '\n'
| error '\n'
;

exp:
  NUM                { $$ = $1;                                             }
| exp '=' exp
  {
    if ($1.intValue () != $3.intValue ())
      yyerror ("calc: error: " + $1 + " != " + $3);
  }
| exp '+' exp        { $$ = new Integer ($1.intValue () + $3.intValue ());  }
| exp '-' exp        { $$ = new Integer ($1.intValue () - $3.intValue ());  }
| exp '*' exp        { $$ = new Integer ($1.intValue () * $3.intValue ());  }
| exp '/' exp        { $$ = new Integer ($1.intValue () / $3.intValue ());  }
| '-' exp  %prec NEG { $$ = new Integer (-$2.intValue ());                  }
| exp '^' exp        { $$ = new Integer ((int)
                                         Math.pow ($1.intValue (),
                                                   $3.intValue ()));        }
| '(' exp ')'        { $$ = $2;                                             }
| '(' error ')'      { $$ = new Integer (1111);                             }
| '!'                { $$ = new Integer (0); return YYERROR;                }
| '-' error          { $$ = new Integer (0); return YYERROR;                }
;


%%
class CalcLexer implements Calc.Lexer {

  StreamTokenizer st;

  public CalcLexer (InputStream is)
  {
    st = new StreamTokenizer (new InputStreamReader (is));
    st.resetSyntax ();
    st.eolIsSignificant (true);
    st.whitespaceChars (9, 9);
    st.whitespaceChars (32, 32);
    st.wordChars (48, 57);
  }


  public void yyerror (String s)
  {
    System.err.println (s);
  }


  Integer yylval;

  public Object getLVal() {
    return yylval;
  }

  public int yylex () throws IOException {
    int ttype = st.nextToken ();

    if (ttype == st.TT_EOF)
      return Calc.EOF;

    else if (ttype == st.TT_EOL)
      {

        return (int) '\n';
      }

    else if (ttype == st.TT_WORD)
      {
        yylval = new Integer (st.sval);
        return Calc.NUM;
      }

    else
      return st.ttype;
  }



}


class Position {
  public int line;

  public Position ()
  {
    line = 0;
  }

  public Position (int l)
  {
    line = l;
  }

  public long getHashCode ()
  {
    return line;
  }

  public boolean equals (Position l)
  {
    return l.line == line;
  }

  public String toString ()
  {
    return Integer.toString (line);
  }

  public int lineno ()
  {
    return line;
  }
}

_ATEOF




if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:385: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o Calc.java Calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:385"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o Calc.java Calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:385: bison --xml=xml-tests/test.xml -o Calc.java Calc.y"
at_fn_check_prepare_trace "java.at:385"
( $at_check_trace; bison --xml=xml-tests/test.xml -o Calc.java Calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:385: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:385"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:385: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:385"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:385: bison -o Calc.java Calc.y"
at_fn_check_prepare_trace "java.at:385"
( $at_check_trace; bison -o Calc.java Calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:385: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:385"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:385: \$SHELL ../../../javacomp.sh Calc.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:385"
( $at_check_trace; $SHELL ../../../javacomp.sh Calc.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:385:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:385"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:385:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:385"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected number
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:385: cat stderr"
at_fn_check_prepare_trace "java.at:385"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:385:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:385"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:385: cat stderr"
at_fn_check_prepare_trace "java.at:385"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:385:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:385"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected $undefined
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:385: cat stderr"
at_fn_check_prepare_trace "java.at:385"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:385:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:385"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected '='
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:385: cat stderr"
at_fn_check_prepare_trace "java.at:385"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:385:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:385"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
2: syntax error, unexpected '+'
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:385: cat stderr"
at_fn_check_prepare_trace "java.at:385"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/java.at:385:  \$SHELL ../../../javaexec.sh Calc < /dev/null"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:385"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected end of input
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:385: cat stderr"
at_fn_check_prepare_trace "java.at:385"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:385:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:385"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:385: cat stderr"
at_fn_check_prepare_trace "java.at:385"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:385:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:385"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:385: cat stderr"
at_fn_check_prepare_trace "java.at:385"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:385:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:385"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:385: cat stderr"
at_fn_check_prepare_trace "java.at:385"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_200
#AT_START_201
# 201. java.at:385: Calculator %error-verbose
at_setup_line='java.at:385'
at_fn_banner 18
at_desc="Calculator %error-verbose "
at_desc_line="201: $at_desc                     "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "201. java.at:385: testing ..."
  $at_traceon







# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.












cat >Calc.y <<'_ATEOF'
/* Infix notation calculator--calc */
%language "Java"
%name-prefix "Calc"
%define parser_class_name "Calc"
%define public

%error-verbose
%code {

  public static void main (String args[]) throws IOException
  {
    CalcLexer l = new CalcLexer (System.in);
    Calc p = new Calc (l);
    p.parse ();
  }

}

%code imports {
  import java.io.StreamTokenizer;
  import java.io.InputStream;
  import java.io.InputStreamReader;
  import java.io.Reader;
  import java.io.IOException;
}

/* Bison Declarations */
%token <Integer> NUM "number"
%type  <Integer> exp

%nonassoc '=' /* comparison            */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line
;

line:
  '\n'
| exp '\n'
| error '\n'
;

exp:
  NUM                { $$ = $1;                                             }
| exp '=' exp
  {
    if ($1.intValue () != $3.intValue ())
      yyerror ("calc: error: " + $1 + " != " + $3);
  }
| exp '+' exp        { $$ = new Integer ($1.intValue () + $3.intValue ());  }
| exp '-' exp        { $$ = new Integer ($1.intValue () - $3.intValue ());  }
| exp '*' exp        { $$ = new Integer ($1.intValue () * $3.intValue ());  }
| exp '/' exp        { $$ = new Integer ($1.intValue () / $3.intValue ());  }
| '-' exp  %prec NEG { $$ = new Integer (-$2.intValue ());                  }
| exp '^' exp        { $$ = new Integer ((int)
                                         Math.pow ($1.intValue (),
                                                   $3.intValue ()));        }
| '(' exp ')'        { $$ = $2;                                             }
| '(' error ')'      { $$ = new Integer (1111);                             }
| '!'                { $$ = new Integer (0); return YYERROR;                }
| '-' error          { $$ = new Integer (0); return YYERROR;                }
;


%%
class CalcLexer implements Calc.Lexer {

  StreamTokenizer st;

  public CalcLexer (InputStream is)
  {
    st = new StreamTokenizer (new InputStreamReader (is));
    st.resetSyntax ();
    st.eolIsSignificant (true);
    st.whitespaceChars (9, 9);
    st.whitespaceChars (32, 32);
    st.wordChars (48, 57);
  }


  public void yyerror (String s)
  {
    System.err.println (s);
  }


  Integer yylval;

  public Object getLVal() {
    return yylval;
  }

  public int yylex () throws IOException {
    int ttype = st.nextToken ();

    if (ttype == st.TT_EOF)
      return Calc.EOF;

    else if (ttype == st.TT_EOL)
      {

        return (int) '\n';
      }

    else if (ttype == st.TT_WORD)
      {
        yylval = new Integer (st.sval);
        return Calc.NUM;
      }

    else
      return st.ttype;
  }



}


class Position {
  public int line;

  public Position ()
  {
    line = 0;
  }

  public Position (int l)
  {
    line = l;
  }

  public long getHashCode ()
  {
    return line;
  }

  public boolean equals (Position l)
  {
    return l.line == line;
  }

  public String toString ()
  {
    return Integer.toString (line);
  }

  public int lineno ()
  {
    return line;
  }
}

_ATEOF




if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:385: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o Calc.java Calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:385"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o Calc.java Calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:385: bison --xml=xml-tests/test.xml -o Calc.java Calc.y"
at_fn_check_prepare_trace "java.at:385"
( $at_check_trace; bison --xml=xml-tests/test.xml -o Calc.java Calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:385: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:385"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:385: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:385"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:385: bison -o Calc.java Calc.y"
at_fn_check_prepare_trace "java.at:385"
( $at_check_trace; bison -o Calc.java Calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:385: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:385"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:385: \$SHELL ../../../javacomp.sh Calc.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:385"
( $at_check_trace; $SHELL ../../../javacomp.sh Calc.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:385:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:385"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:385:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:385"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected number
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the`, unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:385: cat stderr"
at_fn_check_prepare_trace "java.at:385"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:385:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:385"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the`, unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:385: cat stderr"
at_fn_check_prepare_trace "java.at:385"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:385:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:385"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected $undefined
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the`, unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:385: cat stderr"
at_fn_check_prepare_trace "java.at:385"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:385:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:385"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected '='
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the`, unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:385: cat stderr"
at_fn_check_prepare_trace "java.at:385"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:385:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:385"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
2: syntax error, unexpected '+'
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the`, unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:385: cat stderr"
at_fn_check_prepare_trace "java.at:385"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/java.at:385:  \$SHELL ../../../javaexec.sh Calc < /dev/null"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:385"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected end of input
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the`, unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:385: cat stderr"
at_fn_check_prepare_trace "java.at:385"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:385:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:385"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the`, unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:385: cat stderr"
at_fn_check_prepare_trace "java.at:385"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:385:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:385"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the`, unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:385: cat stderr"
at_fn_check_prepare_trace "java.at:385"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:385:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:385"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the`, unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:385: cat stderr"
at_fn_check_prepare_trace "java.at:385"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_201
#AT_START_202
# 202. java.at:385: Calculator %locations
at_setup_line='java.at:385'
at_fn_banner 18
at_desc="Calculator %locations "
at_desc_line="202: $at_desc                         "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "202. java.at:385: testing ..."
  $at_traceon







# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.












cat >Calc.y <<'_ATEOF'
/* Infix notation calculator--calc */
%language "Java"
%name-prefix "Calc"
%define parser_class_name "Calc"
%define public

%locations
%code {

  public static void main (String args[]) throws IOException
  {
    CalcLexer l = new CalcLexer (System.in);
    Calc p = new Calc (l);
    p.parse ();
  }

}

%code imports {
  import java.io.StreamTokenizer;
  import java.io.InputStream;
  import java.io.InputStreamReader;
  import java.io.Reader;
  import java.io.IOException;
}

/* Bison Declarations */
%token <Integer> NUM "number"
%type  <Integer> exp

%nonassoc '=' /* comparison            */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line
;

line:
  '\n'
| exp '\n'
| error '\n'
;

exp:
  NUM                { $$ = $1;                                             }
| exp '=' exp
  {
    if ($1.intValue () != $3.intValue ())
      yyerror ("calc: error: " + $1 + " != " + $3);
  }
| exp '+' exp        { $$ = new Integer ($1.intValue () + $3.intValue ());  }
| exp '-' exp        { $$ = new Integer ($1.intValue () - $3.intValue ());  }
| exp '*' exp        { $$ = new Integer ($1.intValue () * $3.intValue ());  }
| exp '/' exp        { $$ = new Integer ($1.intValue () / $3.intValue ());  }
| '-' exp  %prec NEG { $$ = new Integer (-$2.intValue ());                  }
| exp '^' exp        { $$ = new Integer ((int)
                                         Math.pow ($1.intValue (),
                                                   $3.intValue ()));        }
| '(' exp ')'        { $$ = $2;                                             }
| '(' error ')'      { $$ = new Integer (1111);                             }
| '!'                { $$ = new Integer (0); return YYERROR;                }
| '-' error          { $$ = new Integer (0); return YYERROR;                }
;


%%
class CalcLexer implements Calc.Lexer {

  StreamTokenizer st;

  public CalcLexer (InputStream is)
  {
    st = new StreamTokenizer (new InputStreamReader (is));
    st.resetSyntax ();
    st.eolIsSignificant (true);
    st.whitespaceChars (9, 9);
    st.whitespaceChars (32, 32);
    st.wordChars (48, 57);
  }


  Position yystartpos;
  Position yyendpos = new Position (1);

  public Position getStartPos() {
    return yystartpos;
  }

  public Position getEndPos() {
    return yyendpos;
  }

  public void yyerror (Calc.Location l, String s)
  {
    if (l == null)
      System.err.println (s);
    else
      System.err.println (l.begin + ": " + s);
  }


  Integer yylval;

  public Object getLVal() {
    return yylval;
  }

  public int yylex () throws IOException {
    int ttype = st.nextToken ();
    yystartpos = yyendpos;
    if (ttype == st.TT_EOF)
      return Calc.EOF;

    else if (ttype == st.TT_EOL)
      {
        yyendpos = new Position (yyendpos.lineno () + 1);
        return (int) '\n';
      }

    else if (ttype == st.TT_WORD)
      {
        yylval = new Integer (st.sval);
        return Calc.NUM;
      }

    else
      return st.ttype;
  }



}


class Position {
  public int line;

  public Position ()
  {
    line = 0;
  }

  public Position (int l)
  {
    line = l;
  }

  public long getHashCode ()
  {
    return line;
  }

  public boolean equals (Position l)
  {
    return l.line == line;
  }

  public String toString ()
  {
    return Integer.toString (line);
  }

  public int lineno ()
  {
    return line;
  }
}

_ATEOF




if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:385: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o Calc.java Calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:385"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o Calc.java Calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:385: bison --xml=xml-tests/test.xml -o Calc.java Calc.y"
at_fn_check_prepare_trace "java.at:385"
( $at_check_trace; bison --xml=xml-tests/test.xml -o Calc.java Calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:385: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:385"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:385: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:385"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:385: bison -o Calc.java Calc.y"
at_fn_check_prepare_trace "java.at:385"
( $at_check_trace; bison -o Calc.java Calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:385: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:385"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:385: \$SHELL ../../../javacomp.sh Calc.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:385"
( $at_check_trace; $SHELL ../../../javacomp.sh Calc.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:385:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:385"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:385:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:385"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected number
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:385: cat stderr"
at_fn_check_prepare_trace "java.at:385"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:385:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:385"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:385: cat stderr"
at_fn_check_prepare_trace "java.at:385"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:385:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:385"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected $undefined
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:385: cat stderr"
at_fn_check_prepare_trace "java.at:385"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:385:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:385"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected '='
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:385: cat stderr"
at_fn_check_prepare_trace "java.at:385"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:385:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:385"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
2: syntax error, unexpected '+'
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:385: cat stderr"
at_fn_check_prepare_trace "java.at:385"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/java.at:385:  \$SHELL ../../../javaexec.sh Calc < /dev/null"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:385"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected end of input
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:385: cat stderr"
at_fn_check_prepare_trace "java.at:385"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:385:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:385"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:385: cat stderr"
at_fn_check_prepare_trace "java.at:385"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:385:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:385"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:385: cat stderr"
at_fn_check_prepare_trace "java.at:385"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:385:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:385"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:385: cat stderr"
at_fn_check_prepare_trace "java.at:385"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_202
#AT_START_203
# 203. java.at:385: Calculator %error-verbose %locations
at_setup_line='java.at:385'
at_fn_banner 18
at_desc="Calculator %error-verbose %locations "
at_desc_line="203: $at_desc          "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "203. java.at:385: testing ..."
  $at_traceon







# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.












cat >Calc.y <<'_ATEOF'
/* Infix notation calculator--calc */
%language "Java"
%name-prefix "Calc"
%define parser_class_name "Calc"
%define public

%error-verbose %locations
%code {

  public static void main (String args[]) throws IOException
  {
    CalcLexer l = new CalcLexer (System.in);
    Calc p = new Calc (l);
    p.parse ();
  }

}

%code imports {
  import java.io.StreamTokenizer;
  import java.io.InputStream;
  import java.io.InputStreamReader;
  import java.io.Reader;
  import java.io.IOException;
}

/* Bison Declarations */
%token <Integer> NUM "number"
%type  <Integer> exp

%nonassoc '=' /* comparison            */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line
;

line:
  '\n'
| exp '\n'
| error '\n'
;

exp:
  NUM                { $$ = $1;                                             }
| exp '=' exp
  {
    if ($1.intValue () != $3.intValue ())
      yyerror ("calc: error: " + $1 + " != " + $3);
  }
| exp '+' exp        { $$ = new Integer ($1.intValue () + $3.intValue ());  }
| exp '-' exp        { $$ = new Integer ($1.intValue () - $3.intValue ());  }
| exp '*' exp        { $$ = new Integer ($1.intValue () * $3.intValue ());  }
| exp '/' exp        { $$ = new Integer ($1.intValue () / $3.intValue ());  }
| '-' exp  %prec NEG { $$ = new Integer (-$2.intValue ());                  }
| exp '^' exp        { $$ = new Integer ((int)
                                         Math.pow ($1.intValue (),
                                                   $3.intValue ()));        }
| '(' exp ')'        { $$ = $2;                                             }
| '(' error ')'      { $$ = new Integer (1111);                             }
| '!'                { $$ = new Integer (0); return YYERROR;                }
| '-' error          { $$ = new Integer (0); return YYERROR;                }
;


%%
class CalcLexer implements Calc.Lexer {

  StreamTokenizer st;

  public CalcLexer (InputStream is)
  {
    st = new StreamTokenizer (new InputStreamReader (is));
    st.resetSyntax ();
    st.eolIsSignificant (true);
    st.whitespaceChars (9, 9);
    st.whitespaceChars (32, 32);
    st.wordChars (48, 57);
  }


  Position yystartpos;
  Position yyendpos = new Position (1);

  public Position getStartPos() {
    return yystartpos;
  }

  public Position getEndPos() {
    return yyendpos;
  }

  public void yyerror (Calc.Location l, String s)
  {
    if (l == null)
      System.err.println (s);
    else
      System.err.println (l.begin + ": " + s);
  }


  Integer yylval;

  public Object getLVal() {
    return yylval;
  }

  public int yylex () throws IOException {
    int ttype = st.nextToken ();
    yystartpos = yyendpos;
    if (ttype == st.TT_EOF)
      return Calc.EOF;

    else if (ttype == st.TT_EOL)
      {
        yyendpos = new Position (yyendpos.lineno () + 1);
        return (int) '\n';
      }

    else if (ttype == st.TT_WORD)
      {
        yylval = new Integer (st.sval);
        return Calc.NUM;
      }

    else
      return st.ttype;
  }



}


class Position {
  public int line;

  public Position ()
  {
    line = 0;
  }

  public Position (int l)
  {
    line = l;
  }

  public long getHashCode ()
  {
    return line;
  }

  public boolean equals (Position l)
  {
    return l.line == line;
  }

  public String toString ()
  {
    return Integer.toString (line);
  }

  public int lineno ()
  {
    return line;
  }
}

_ATEOF




if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:385: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o Calc.java Calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:385"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o Calc.java Calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:385: bison --xml=xml-tests/test.xml -o Calc.java Calc.y"
at_fn_check_prepare_trace "java.at:385"
( $at_check_trace; bison --xml=xml-tests/test.xml -o Calc.java Calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:385: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:385"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:385: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:385"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:385: bison -o Calc.java Calc.y"
at_fn_check_prepare_trace "java.at:385"
( $at_check_trace; bison -o Calc.java Calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:385: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:385"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:385: \$SHELL ../../../javacomp.sh Calc.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:385"
( $at_check_trace; $SHELL ../../../javacomp.sh Calc.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:385:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:385"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:385:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:385"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected number
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the`, unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:385: cat stderr"
at_fn_check_prepare_trace "java.at:385"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:385:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:385"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the`, unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:385: cat stderr"
at_fn_check_prepare_trace "java.at:385"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:385:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:385"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected $undefined
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the`, unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:385: cat stderr"
at_fn_check_prepare_trace "java.at:385"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:385:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:385"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected '='
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the`, unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:385: cat stderr"
at_fn_check_prepare_trace "java.at:385"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:385:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:385"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
2: syntax error, unexpected '+'
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the`, unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:385: cat stderr"
at_fn_check_prepare_trace "java.at:385"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/java.at:385:  \$SHELL ../../../javaexec.sh Calc < /dev/null"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:385"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected end of input
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the`, unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:385: cat stderr"
at_fn_check_prepare_trace "java.at:385"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:385:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:385"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the`, unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:385: cat stderr"
at_fn_check_prepare_trace "java.at:385"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:385:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:385"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the`, unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:385: cat stderr"
at_fn_check_prepare_trace "java.at:385"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:385:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:385"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the`, unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:385: cat stderr"
at_fn_check_prepare_trace "java.at:385"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:385"
$at_failed && at_fn_log_failure
$at_traceon; }


























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_203
#AT_START_204
# 204. java.at:394: Calculator %lex-param { InputStream is }
at_setup_line='java.at:394'
at_fn_banner 18
at_desc="Calculator %lex-param { InputStream is } "
at_desc_line="204: $at_desc      "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "204. java.at:394: testing ..."
  $at_traceon







# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.












cat >Calc.y <<'_ATEOF'
/* Infix notation calculator--calc */
%language "Java"
%name-prefix "Calc"
%define parser_class_name "Calc"
%define public

%lex-param { InputStream is }
%code {

  public static void main (String args[]) throws IOException
  {
    new Calc (System.in).parse ();
  }

}

%code imports {
  import java.io.StreamTokenizer;
  import java.io.InputStream;
  import java.io.InputStreamReader;
  import java.io.Reader;
  import java.io.IOException;
}

/* Bison Declarations */
%token <Integer> NUM "number"
%type  <Integer> exp

%nonassoc '=' /* comparison            */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line
;

line:
  '\n'
| exp '\n'
| error '\n'
;

exp:
  NUM                { $$ = $1;                                             }
| exp '=' exp
  {
    if ($1.intValue () != $3.intValue ())
      yyerror ("calc: error: " + $1 + " != " + $3);
  }
| exp '+' exp        { $$ = new Integer ($1.intValue () + $3.intValue ());  }
| exp '-' exp        { $$ = new Integer ($1.intValue () - $3.intValue ());  }
| exp '*' exp        { $$ = new Integer ($1.intValue () * $3.intValue ());  }
| exp '/' exp        { $$ = new Integer ($1.intValue () / $3.intValue ());  }
| '-' exp  %prec NEG { $$ = new Integer (-$2.intValue ());                  }
| exp '^' exp        { $$ = new Integer ((int)
                                         Math.pow ($1.intValue (),
                                                   $3.intValue ()));        }
| '(' exp ')'        { $$ = $2;                                             }
| '(' error ')'      { $$ = new Integer (1111);                             }
| '!'                { $$ = new Integer (0); return YYERROR;                }
| '-' error          { $$ = new Integer (0); return YYERROR;                }
;


%code lexer {

  StreamTokenizer st;

  public YYLexer (InputStream is)
  {
    st = new StreamTokenizer (new InputStreamReader (is));
    st.resetSyntax ();
    st.eolIsSignificant (true);
    st.whitespaceChars (9, 9);
    st.whitespaceChars (32, 32);
    st.wordChars (48, 57);
  }


  public void yyerror (String s)
  {
    System.err.println (s);
  }


  Integer yylval;

  public Object getLVal() {
    return yylval;
  }

  public int yylex () throws IOException {
    int ttype = st.nextToken ();

    if (ttype == st.TT_EOF)
      return Calc.EOF;

    else if (ttype == st.TT_EOL)
      {

        return (int) '\n';
      }

    else if (ttype == st.TT_WORD)
      {
        yylval = new Integer (st.sval);
        return Calc.NUM;
      }

    else
      return st.ttype;
  }



};
%%


class Position {
  public int line;

  public Position ()
  {
    line = 0;
  }

  public Position (int l)
  {
    line = l;
  }

  public long getHashCode ()
  {
    return line;
  }

  public boolean equals (Position l)
  {
    return l.line == line;
  }

  public String toString ()
  {
    return Integer.toString (line);
  }

  public int lineno ()
  {
    return line;
  }
}

_ATEOF




if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:394: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o Calc.java Calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:394"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o Calc.java Calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:394: bison --xml=xml-tests/test.xml -o Calc.java Calc.y"
at_fn_check_prepare_trace "java.at:394"
( $at_check_trace; bison --xml=xml-tests/test.xml -o Calc.java Calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:394: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:394"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:394: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:394"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:394: bison -o Calc.java Calc.y"
at_fn_check_prepare_trace "java.at:394"
( $at_check_trace; bison -o Calc.java Calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:394: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:394"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:394: \$SHELL ../../../javacomp.sh Calc.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:394"
( $at_check_trace; $SHELL ../../../javacomp.sh Calc.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:394:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:394"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:394:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:394"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected number
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:394: cat stderr"
at_fn_check_prepare_trace "java.at:394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:394:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:394"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:394: cat stderr"
at_fn_check_prepare_trace "java.at:394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:394:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:394"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected $undefined
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:394: cat stderr"
at_fn_check_prepare_trace "java.at:394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:394:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:394"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected '='
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:394: cat stderr"
at_fn_check_prepare_trace "java.at:394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:394:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:394"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
2: syntax error, unexpected '+'
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:394: cat stderr"
at_fn_check_prepare_trace "java.at:394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/java.at:394:  \$SHELL ../../../javaexec.sh Calc < /dev/null"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:394"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected end of input
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:394: cat stderr"
at_fn_check_prepare_trace "java.at:394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:394:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:394"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:394: cat stderr"
at_fn_check_prepare_trace "java.at:394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:394:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:394"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:394: cat stderr"
at_fn_check_prepare_trace "java.at:394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:394:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:394"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:394: cat stderr"
at_fn_check_prepare_trace "java.at:394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_204
#AT_START_205
# 205. java.at:394: Calculator %error-verbose %lex-param { InputStream is }
at_setup_line='java.at:394'
at_fn_banner 18
at_desc="Calculator %error-verbose %lex-param { InputStream is } "
at_desc_line="205: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "205. java.at:394: testing ..."
  $at_traceon







# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.












cat >Calc.y <<'_ATEOF'
/* Infix notation calculator--calc */
%language "Java"
%name-prefix "Calc"
%define parser_class_name "Calc"
%define public

%error-verbose %lex-param { InputStream is }
%code {

  public static void main (String args[]) throws IOException
  {
    new Calc (System.in).parse ();
  }

}

%code imports {
  import java.io.StreamTokenizer;
  import java.io.InputStream;
  import java.io.InputStreamReader;
  import java.io.Reader;
  import java.io.IOException;
}

/* Bison Declarations */
%token <Integer> NUM "number"
%type  <Integer> exp

%nonassoc '=' /* comparison            */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line
;

line:
  '\n'
| exp '\n'
| error '\n'
;

exp:
  NUM                { $$ = $1;                                             }
| exp '=' exp
  {
    if ($1.intValue () != $3.intValue ())
      yyerror ("calc: error: " + $1 + " != " + $3);
  }
| exp '+' exp        { $$ = new Integer ($1.intValue () + $3.intValue ());  }
| exp '-' exp        { $$ = new Integer ($1.intValue () - $3.intValue ());  }
| exp '*' exp        { $$ = new Integer ($1.intValue () * $3.intValue ());  }
| exp '/' exp        { $$ = new Integer ($1.intValue () / $3.intValue ());  }
| '-' exp  %prec NEG { $$ = new Integer (-$2.intValue ());                  }
| exp '^' exp        { $$ = new Integer ((int)
                                         Math.pow ($1.intValue (),
                                                   $3.intValue ()));        }
| '(' exp ')'        { $$ = $2;                                             }
| '(' error ')'      { $$ = new Integer (1111);                             }
| '!'                { $$ = new Integer (0); return YYERROR;                }
| '-' error          { $$ = new Integer (0); return YYERROR;                }
;


%code lexer {

  StreamTokenizer st;

  public YYLexer (InputStream is)
  {
    st = new StreamTokenizer (new InputStreamReader (is));
    st.resetSyntax ();
    st.eolIsSignificant (true);
    st.whitespaceChars (9, 9);
    st.whitespaceChars (32, 32);
    st.wordChars (48, 57);
  }


  public void yyerror (String s)
  {
    System.err.println (s);
  }


  Integer yylval;

  public Object getLVal() {
    return yylval;
  }

  public int yylex () throws IOException {
    int ttype = st.nextToken ();

    if (ttype == st.TT_EOF)
      return Calc.EOF;

    else if (ttype == st.TT_EOL)
      {

        return (int) '\n';
      }

    else if (ttype == st.TT_WORD)
      {
        yylval = new Integer (st.sval);
        return Calc.NUM;
      }

    else
      return st.ttype;
  }



};
%%


class Position {
  public int line;

  public Position ()
  {
    line = 0;
  }

  public Position (int l)
  {
    line = l;
  }

  public long getHashCode ()
  {
    return line;
  }

  public boolean equals (Position l)
  {
    return l.line == line;
  }

  public String toString ()
  {
    return Integer.toString (line);
  }

  public int lineno ()
  {
    return line;
  }
}

_ATEOF




if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:394: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o Calc.java Calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:394"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o Calc.java Calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:394: bison --xml=xml-tests/test.xml -o Calc.java Calc.y"
at_fn_check_prepare_trace "java.at:394"
( $at_check_trace; bison --xml=xml-tests/test.xml -o Calc.java Calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:394: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:394"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:394: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:394"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:394: bison -o Calc.java Calc.y"
at_fn_check_prepare_trace "java.at:394"
( $at_check_trace; bison -o Calc.java Calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:394: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:394"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:394: \$SHELL ../../../javacomp.sh Calc.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:394"
( $at_check_trace; $SHELL ../../../javacomp.sh Calc.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:394:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:394"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:394:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:394"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected number
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the`, unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:394: cat stderr"
at_fn_check_prepare_trace "java.at:394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:394:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:394"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the`, unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:394: cat stderr"
at_fn_check_prepare_trace "java.at:394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:394:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:394"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected $undefined
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the`, unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:394: cat stderr"
at_fn_check_prepare_trace "java.at:394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:394:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:394"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected '='
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the`, unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:394: cat stderr"
at_fn_check_prepare_trace "java.at:394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:394:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:394"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
2: syntax error, unexpected '+'
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the`, unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:394: cat stderr"
at_fn_check_prepare_trace "java.at:394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/java.at:394:  \$SHELL ../../../javaexec.sh Calc < /dev/null"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:394"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected end of input
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the`, unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:394: cat stderr"
at_fn_check_prepare_trace "java.at:394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:394:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:394"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the`, unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:394: cat stderr"
at_fn_check_prepare_trace "java.at:394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:394:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:394"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the`, unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:394: cat stderr"
at_fn_check_prepare_trace "java.at:394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:394:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:394"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 2. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 3. If error-verbose is not used, strip the`, unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:394: cat stderr"
at_fn_check_prepare_trace "java.at:394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_205
#AT_START_206
# 206. java.at:394: Calculator %locations %lex-param { InputStream is }
at_setup_line='java.at:394'
at_fn_banner 18
at_desc="Calculator %locations %lex-param { InputStream is } "
at_desc_line="206: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "206. java.at:394: testing ..."
  $at_traceon







# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.












cat >Calc.y <<'_ATEOF'
/* Infix notation calculator--calc */
%language "Java"
%name-prefix "Calc"
%define parser_class_name "Calc"
%define public

%locations %lex-param { InputStream is }
%code {

  public static void main (String args[]) throws IOException
  {
    new Calc (System.in).parse ();
  }

}

%code imports {
  import java.io.StreamTokenizer;
  import java.io.InputStream;
  import java.io.InputStreamReader;
  import java.io.Reader;
  import java.io.IOException;
}

/* Bison Declarations */
%token <Integer> NUM "number"
%type  <Integer> exp

%nonassoc '=' /* comparison            */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line
;

line:
  '\n'
| exp '\n'
| error '\n'
;

exp:
  NUM                { $$ = $1;                                             }
| exp '=' exp
  {
    if ($1.intValue () != $3.intValue ())
      yyerror ("calc: error: " + $1 + " != " + $3);
  }
| exp '+' exp        { $$ = new Integer ($1.intValue () + $3.intValue ());  }
| exp '-' exp        { $$ = new Integer ($1.intValue () - $3.intValue ());  }
| exp '*' exp        { $$ = new Integer ($1.intValue () * $3.intValue ());  }
| exp '/' exp        { $$ = new Integer ($1.intValue () / $3.intValue ());  }
| '-' exp  %prec NEG { $$ = new Integer (-$2.intValue ());                  }
| exp '^' exp        { $$ = new Integer ((int)
                                         Math.pow ($1.intValue (),
                                                   $3.intValue ()));        }
| '(' exp ')'        { $$ = $2;                                             }
| '(' error ')'      { $$ = new Integer (1111);                             }
| '!'                { $$ = new Integer (0); return YYERROR;                }
| '-' error          { $$ = new Integer (0); return YYERROR;                }
;


%code lexer {

  StreamTokenizer st;

  public YYLexer (InputStream is)
  {
    st = new StreamTokenizer (new InputStreamReader (is));
    st.resetSyntax ();
    st.eolIsSignificant (true);
    st.whitespaceChars (9, 9);
    st.whitespaceChars (32, 32);
    st.wordChars (48, 57);
  }


  Position yystartpos;
  Position yyendpos = new Position (1);

  public Position getStartPos() {
    return yystartpos;
  }

  public Position getEndPos() {
    return yyendpos;
  }

  public void yyerror (Calc.Location l, String s)
  {
    if (l == null)
      System.err.println (s);
    else
      System.err.println (l.begin + ": " + s);
  }


  Integer yylval;

  public Object getLVal() {
    return yylval;
  }

  public int yylex () throws IOException {
    int ttype = st.nextToken ();
    yystartpos = yyendpos;
    if (ttype == st.TT_EOF)
      return Calc.EOF;

    else if (ttype == st.TT_EOL)
      {
        yyendpos = new Position (yyendpos.lineno () + 1);
        return (int) '\n';
      }

    else if (ttype == st.TT_WORD)
      {
        yylval = new Integer (st.sval);
        return Calc.NUM;
      }

    else
      return st.ttype;
  }



};
%%


class Position {
  public int line;

  public Position ()
  {
    line = 0;
  }

  public Position (int l)
  {
    line = l;
  }

  public long getHashCode ()
  {
    return line;
  }

  public boolean equals (Position l)
  {
    return l.line == line;
  }

  public String toString ()
  {
    return Integer.toString (line);
  }

  public int lineno ()
  {
    return line;
  }
}

_ATEOF




if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:394: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o Calc.java Calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:394"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o Calc.java Calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:394: bison --xml=xml-tests/test.xml -o Calc.java Calc.y"
at_fn_check_prepare_trace "java.at:394"
( $at_check_trace; bison --xml=xml-tests/test.xml -o Calc.java Calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:394: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:394"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:394: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:394"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:394: bison -o Calc.java Calc.y"
at_fn_check_prepare_trace "java.at:394"
( $at_check_trace; bison -o Calc.java Calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:394: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:394"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:394: \$SHELL ../../../javacomp.sh Calc.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:394"
( $at_check_trace; $SHELL ../../../javacomp.sh Calc.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:394:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:394"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:394:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:394"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected number
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:394: cat stderr"
at_fn_check_prepare_trace "java.at:394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:394:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:394"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:394: cat stderr"
at_fn_check_prepare_trace "java.at:394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:394:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:394"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected $undefined
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:394: cat stderr"
at_fn_check_prepare_trace "java.at:394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:394:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:394"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected '='
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:394: cat stderr"
at_fn_check_prepare_trace "java.at:394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:394:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:394"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
2: syntax error, unexpected '+'
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:394: cat stderr"
at_fn_check_prepare_trace "java.at:394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/java.at:394:  \$SHELL ../../../javaexec.sh Calc < /dev/null"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:394"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected end of input
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:394: cat stderr"
at_fn_check_prepare_trace "java.at:394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:394:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:394"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:394: cat stderr"
at_fn_check_prepare_trace "java.at:394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:394:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:394"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:394: cat stderr"
at_fn_check_prepare_trace "java.at:394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:394:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:394"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the`, unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:394: cat stderr"
at_fn_check_prepare_trace "java.at:394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_206
#AT_START_207
# 207. java.at:394: Calculator %error-verbose %locations %lex-param { InputStream is }
at_setup_line='java.at:394'
at_fn_banner 18
at_desc="Calculator %error-verbose %locations %lex-param { InputStream is } "
at_desc_line="207: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "207. java.at:394: testing ..."
  $at_traceon







# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.












cat >Calc.y <<'_ATEOF'
/* Infix notation calculator--calc */
%language "Java"
%name-prefix "Calc"
%define parser_class_name "Calc"
%define public

%error-verbose %locations %lex-param { InputStream is }
%code {

  public static void main (String args[]) throws IOException
  {
    new Calc (System.in).parse ();
  }

}

%code imports {
  import java.io.StreamTokenizer;
  import java.io.InputStream;
  import java.io.InputStreamReader;
  import java.io.Reader;
  import java.io.IOException;
}

/* Bison Declarations */
%token <Integer> NUM "number"
%type  <Integer> exp

%nonassoc '=' /* comparison            */
%left '-' '+'
%left '*' '/'
%left NEG     /* negation--unary minus */
%right '^'    /* exponentiation        */

/* Grammar follows */
%%
input:
  line
| input line
;

line:
  '\n'
| exp '\n'
| error '\n'
;

exp:
  NUM                { $$ = $1;                                             }
| exp '=' exp
  {
    if ($1.intValue () != $3.intValue ())
      yyerror ("calc: error: " + $1 + " != " + $3);
  }
| exp '+' exp        { $$ = new Integer ($1.intValue () + $3.intValue ());  }
| exp '-' exp        { $$ = new Integer ($1.intValue () - $3.intValue ());  }
| exp '*' exp        { $$ = new Integer ($1.intValue () * $3.intValue ());  }
| exp '/' exp        { $$ = new Integer ($1.intValue () / $3.intValue ());  }
| '-' exp  %prec NEG { $$ = new Integer (-$2.intValue ());                  }
| exp '^' exp        { $$ = new Integer ((int)
                                         Math.pow ($1.intValue (),
                                                   $3.intValue ()));        }
| '(' exp ')'        { $$ = $2;                                             }
| '(' error ')'      { $$ = new Integer (1111);                             }
| '!'                { $$ = new Integer (0); return YYERROR;                }
| '-' error          { $$ = new Integer (0); return YYERROR;                }
;


%code lexer {

  StreamTokenizer st;

  public YYLexer (InputStream is)
  {
    st = new StreamTokenizer (new InputStreamReader (is));
    st.resetSyntax ();
    st.eolIsSignificant (true);
    st.whitespaceChars (9, 9);
    st.whitespaceChars (32, 32);
    st.wordChars (48, 57);
  }


  Position yystartpos;
  Position yyendpos = new Position (1);

  public Position getStartPos() {
    return yystartpos;
  }

  public Position getEndPos() {
    return yyendpos;
  }

  public void yyerror (Calc.Location l, String s)
  {
    if (l == null)
      System.err.println (s);
    else
      System.err.println (l.begin + ": " + s);
  }


  Integer yylval;

  public Object getLVal() {
    return yylval;
  }

  public int yylex () throws IOException {
    int ttype = st.nextToken ();
    yystartpos = yyendpos;
    if (ttype == st.TT_EOF)
      return Calc.EOF;

    else if (ttype == st.TT_EOL)
      {
        yyendpos = new Position (yyendpos.lineno () + 1);
        return (int) '\n';
      }

    else if (ttype == st.TT_WORD)
      {
        yylval = new Integer (st.sval);
        return Calc.NUM;
      }

    else
      return st.ttype;
  }



};
%%


class Position {
  public int line;

  public Position ()
  {
    line = 0;
  }

  public Position (int l)
  {
    line = l;
  }

  public long getHashCode ()
  {
    return line;
  }

  public boolean equals (Position l)
  {
    return l.line == line;
  }

  public String toString ()
  {
    return Integer.toString (line);
  }

  public int lineno ()
  {
    return line;
  }
}

_ATEOF




if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:394: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o Calc.java Calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:394"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o Calc.java Calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:394: bison --xml=xml-tests/test.xml -o Calc.java Calc.y"
at_fn_check_prepare_trace "java.at:394"
( $at_check_trace; bison --xml=xml-tests/test.xml -o Calc.java Calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:394: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:394"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:394: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:394"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:394: bison -o Calc.java Calc.y"
at_fn_check_prepare_trace "java.at:394"
( $at_check_trace; bison -o Calc.java Calc.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:394: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:394"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:394: \$SHELL ../../../javacomp.sh Calc.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:394"
( $at_check_trace; $SHELL ../../../javacomp.sh Calc.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


# Test the priorities.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5

-1^2 = -1
(-1)^2 = 1

---1 = -1

1 - 2 - 3 = -4
1 - (2 - 3) = 2

2^2^3 = 256
(2^2)^3 = 64
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:394:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:394"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }



# Some syntax errors.
cat >input <<'_ATEOF'
0 0
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:394:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:394"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected number
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the`, unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:394: cat stderr"
at_fn_check_prepare_trace "java.at:394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1//2
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:394:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:394"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected '/', expecting number or '-' or '(' or '!'
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the`, unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:394: cat stderr"
at_fn_check_prepare_trace "java.at:394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
error
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:394:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:394"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected $undefined
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the`, unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:394: cat stderr"
at_fn_check_prepare_trace "java.at:394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:394:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:394"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected '='
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the`, unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:394: cat stderr"
at_fn_check_prepare_trace "java.at:394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'

+1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:394:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:394"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
2: syntax error, unexpected '+'
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the`, unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:394: cat stderr"
at_fn_check_prepare_trace "java.at:394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


# Exercise error messages with EOF: work on an empty file.
{ set +x
$as_echo "$at_srcdir/java.at:394:  \$SHELL ../../../javaexec.sh Calc < /dev/null"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:394"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < /dev/null
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected end of input
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the`, unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:394: cat stderr"
at_fn_check_prepare_trace "java.at:394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }



# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
#   - (): nothing to pop, nothing to discard
#   - (1 + 1 + 1 +): a lot to pop, nothing to discard
#   - (* * *): nothing to pop, a lot to discard
#   - (1 + 2 * *): some to pop and discard
#
# - test the action associated to `error'
#
# - check the lookahead that triggers an error is not discarded
#   when we enter error recovery.  Below, the lookahead causing the
#   first error is ")", which is needed to recover from the error and
#   produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:394:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:394"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1: syntax error, unexpected ')', expecting number or '-' or '(' or '!'
1: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
calc: error: 4444 != 1
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the`, unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:394: cat stderr"
at_fn_check_prepare_trace "java.at:394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }



# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:394:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:394"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the`, unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:394: cat stderr"
at_fn_check_prepare_trace "java.at:394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


cat >input <<'_ATEOF'
(- *) + (0 0) = 1
_ATEOF

{ set +x
$as_echo "$at_srcdir/java.at:394:  \$SHELL ../../../javaexec.sh Calc < input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:394"
( $at_check_trace;  $SHELL ../../../javaexec.sh Calc < input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Create the reference error message.
cat >expout <<'_ATEOF'
1: syntax error, unexpected '*', expecting number or '-' or '(' or '!'
1: syntax error, unexpected number
calc: error: 2222 != 1
_ATEOF

# 2. If locations are not used, remove them.

# 3. If error-verbose is not used, strip the`, unexpected....' part.

# 4. Check
{ set +x
$as_echo "$at_srcdir/java.at:394: cat stderr"
at_fn_check_prepare_trace "java.at:394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }


























  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_207
#AT_START_208
# 208. java.at:480: Java parser class and package names
at_setup_line='java.at:480'
at_fn_banner 19
at_desc="Java parser class and package names"
at_desc_line="208: $at_desc            "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "208. java.at:480: testing ..."
  $at_traceon



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table

%%
start: "end" {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:482: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:482"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:482"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:482: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:482"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:482"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:482: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:482"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:482"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:482: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:482"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:482"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:482: bison YYParser.y"
at_fn_check_prepare_trace "java.at:482"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:482"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:482: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:482"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:482"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:482: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:482"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:482"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:482: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:482"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:482"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:483: grep -c '^class YYParser\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^class YYParser$' YYParser.java" "java.at:483"
( $at_check_trace; grep -c '^class YYParser$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:483"
$at_failed && at_fn_log_failure
$at_traceon; }




cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%name-prefix "Prefix"
%%
start: "end" {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:485: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:485"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:485"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:485: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:485"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:485"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:485: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:485"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:485"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:485: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:485"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:485"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:485: bison YYParser.y"
at_fn_check_prepare_trace "java.at:485"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:485"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:485: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:485"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:485"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:485: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:485"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:485"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:485: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:485"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:485"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:486: grep -c '^class PrefixParser\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^class PrefixParser$' YYParser.java" "java.at:486"
( $at_check_trace; grep -c '^class PrefixParser$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:486"
$at_failed && at_fn_log_failure
$at_traceon; }




cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%define parser_class_name "ParserClassName"
%%
start: "end" {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:488: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:488"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:488"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:488: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:488"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:488"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:488: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:488"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:488"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:488: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:488"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:488"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:488: bison YYParser.y"
at_fn_check_prepare_trace "java.at:488"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:488"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:488: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:488"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:488"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:488: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:488"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:488"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:488: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:488"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:488"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:489: grep -c '^class ParserClassName\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^class ParserClassName$' YYParser.java" "java.at:489"
( $at_check_trace; grep -c '^class ParserClassName$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:489"
$at_failed && at_fn_log_failure
$at_traceon; }




cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%define package "user_java_package"
%%
start: "end" {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:491: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:491"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:491"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:491: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:491"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:491"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:491: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:491"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:491"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:491: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:491"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:491"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:491: bison YYParser.y"
at_fn_check_prepare_trace "java.at:491"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:491"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:491: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:491"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:491"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:491: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:491"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:491"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:491: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:491"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:491"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:492: grep -c '^package user_java_package;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^package user_java_package;$' YYParser.java" "java.at:492"
( $at_check_trace; grep -c '^package user_java_package;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:492"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_208
#AT_START_209
# 209. java.at:501: Java parser class modifiers
at_setup_line='java.at:501'
at_fn_banner 19
at_desc="Java parser class modifiers"
at_desc_line="209: $at_desc                    "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "209. java.at:501: testing ..."
  $at_traceon



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%define abstract
%%
start: "end" {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:503: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:503"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:503"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:503: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:503"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:503"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:503: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:503"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:503"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:503: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:503"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:503"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:503: bison YYParser.y"
at_fn_check_prepare_trace "java.at:503"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:503"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:503: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:503"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:503"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:503: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:503"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:503"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:503: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:503"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:503"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:504: grep -c '^abstract class YYParser\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^abstract class YYParser$' YYParser.java" "java.at:504"
( $at_check_trace; grep -c '^abstract class YYParser$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:504"
$at_failed && at_fn_log_failure
$at_traceon; }




cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%define final
%%
start: "end" {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:506: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:506"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:506"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:506: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:506"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:506"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:506: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:506"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:506"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:506: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:506"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:506"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:506: bison YYParser.y"
at_fn_check_prepare_trace "java.at:506"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:506"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:506: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:506"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:506"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:506: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:506"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:506"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:506: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:506"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:506"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:507: grep -c '^final class YYParser\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^final class YYParser$' YYParser.java" "java.at:507"
( $at_check_trace; grep -c '^final class YYParser$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:507"
$at_failed && at_fn_log_failure
$at_traceon; }




cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%define strictfp
%%
start: "end" {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:509: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:509"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:509"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:509: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:509"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:509"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:509: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:509"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:509"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:509: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:509"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:509"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:509: bison YYParser.y"
at_fn_check_prepare_trace "java.at:509"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:509"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:509: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:509"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:509"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:509: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:509"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:509"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:509: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:509"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:509"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:510: grep -c '^strictfp class YYParser\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^strictfp class YYParser$' YYParser.java" "java.at:510"
( $at_check_trace; grep -c '^strictfp class YYParser$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:510"
$at_failed && at_fn_log_failure
$at_traceon; }




cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table

%define abstract
%define strictfp
%%
start: "end" {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:512: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:512"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:512"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:512: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:512"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:512"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:512: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:512"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:512"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:512: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:512"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:512"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:512: bison YYParser.y"
at_fn_check_prepare_trace "java.at:512"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:512"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:512: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:512"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:512"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:512: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:512"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:512"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:512: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:512"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:512"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:515: grep -c '^abstract strictfp class YYParser\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^abstract strictfp class YYParser$' YYParser.java" "java.at:515"
( $at_check_trace; grep -c '^abstract strictfp class YYParser$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:515"
$at_failed && at_fn_log_failure
$at_traceon; }




cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table

%define final
%define strictfp
%%
start: "end" {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:517: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:517"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:517"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:517: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:517"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:517"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:517: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:517"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:517"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:517: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:517"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:517"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:517: bison YYParser.y"
at_fn_check_prepare_trace "java.at:517"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:517"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:517: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:517"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:517"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:517: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:517"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:517"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:517: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:517"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:517"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:520: grep -c '^final strictfp class YYParser\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^final strictfp class YYParser$' YYParser.java" "java.at:520"
( $at_check_trace; grep -c '^final strictfp class YYParser$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:520"
$at_failed && at_fn_log_failure
$at_traceon; }




cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%define public
%%
start: "end" {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:522: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:522"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:522"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:522: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:522"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:522"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:522: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:522"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:522"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:522: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:522"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:522"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:522: bison YYParser.y"
at_fn_check_prepare_trace "java.at:522"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:522"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:522: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:522"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:522"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:522: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:522"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:522"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:522: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:522"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:522"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:523: grep -c '^public class YYParser\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^public class YYParser$' YYParser.java" "java.at:523"
( $at_check_trace; grep -c '^public class YYParser$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:523"
$at_failed && at_fn_log_failure
$at_traceon; }




cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table

%define public
%define abstract
%%
start: "end" {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:525: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:525"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:525"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:525: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:525"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:525"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:525: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:525"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:525"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:525: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:525"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:525"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:525: bison YYParser.y"
at_fn_check_prepare_trace "java.at:525"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:525"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:525: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:525"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:525"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:525: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:525"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:525"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:525: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:525"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:525"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:528: grep -c '^public abstract class YYParser\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^public abstract class YYParser$' YYParser.java" "java.at:528"
( $at_check_trace; grep -c '^public abstract class YYParser$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:528"
$at_failed && at_fn_log_failure
$at_traceon; }




cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table

%define public
%define final
%%
start: "end" {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:530: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:530"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:530"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:530: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:530"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:530"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:530: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:530"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:530"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:530: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:530"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:530"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:530: bison YYParser.y"
at_fn_check_prepare_trace "java.at:530"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:530"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:530: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:530"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:530"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:530: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:530"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:530"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:530: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:530"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:530"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:533: grep -c '^public final class YYParser\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^public final class YYParser$' YYParser.java" "java.at:533"
( $at_check_trace; grep -c '^public final class YYParser$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:533"
$at_failed && at_fn_log_failure
$at_traceon; }




cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table

%define public
%define strictfp
%%
start: "end" {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:535: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:535"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:535"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:535: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:535"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:535"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:535: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:535"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:535"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:535: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:535"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:535"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:535: bison YYParser.y"
at_fn_check_prepare_trace "java.at:535"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:535"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:535: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:535"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:535"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:535: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:535"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:535"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:535: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:535"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:535"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:538: grep -c '^public strictfp class YYParser\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^public strictfp class YYParser$' YYParser.java" "java.at:538"
( $at_check_trace; grep -c '^public strictfp class YYParser$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:538"
$at_failed && at_fn_log_failure
$at_traceon; }




cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table

%define public
%define abstract
%define strictfp
%%
start: "end" {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:540: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:540"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:540"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:540: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:540"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:540"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:540: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:540"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:540"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:540: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:540"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:540"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:540: bison YYParser.y"
at_fn_check_prepare_trace "java.at:540"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:540"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:540: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:540"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:540"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:540: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:540"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:540"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:540: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:540"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:540"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:544: grep -c '^public abstract strictfp class YYParser\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^public abstract strictfp class YYParser$' YYParser.java" "java.at:544"
( $at_check_trace; grep -c '^public abstract strictfp class YYParser$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:544"
$at_failed && at_fn_log_failure
$at_traceon; }




cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table

%define public
%define final
%define strictfp
%%
start: "end" {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:546: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:546"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:546"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:546: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:546"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:546"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:546: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:546"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:546"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:546: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:546"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:546"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:546: bison YYParser.y"
at_fn_check_prepare_trace "java.at:546"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:546"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:546: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:546"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:546"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:546: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:546"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:546"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:546: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:546"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:546"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:550: grep -c '^public final strictfp class YYParser\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^public final strictfp class YYParser$' YYParser.java" "java.at:550"
( $at_check_trace; grep -c '^public final strictfp class YYParser$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:550"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_209
#AT_START_210
# 210. java.at:559: Java parser class extends and implements
at_setup_line='java.at:559'
at_fn_banner 19
at_desc="Java parser class extends and implements"
at_desc_line="210: $at_desc       "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "210. java.at:559: testing ..."
  $at_traceon



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%define extends "Thread"
%%
start: "end" {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:561: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:561"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:561"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:561: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:561"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:561"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:561: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:561"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:561"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:561: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:561"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:561"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:561: bison YYParser.y"
at_fn_check_prepare_trace "java.at:561"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:561"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:561: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:561"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:561"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:561: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:561"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:561"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:561: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:561"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:561"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:562: grep -c '^class YYParser extends Thread\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^class YYParser extends Thread$' YYParser.java" "java.at:562"
( $at_check_trace; grep -c '^class YYParser extends Thread$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:562"
$at_failed && at_fn_log_failure
$at_traceon; }




cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%define implements "Cloneable"
%%
start: "end" {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:564: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:564"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:564"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:564: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:564"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:564"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:564: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:564"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:564"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:564: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:564"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:564"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:564: bison YYParser.y"
at_fn_check_prepare_trace "java.at:564"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:564"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:564: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:564"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:564"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:564: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:564"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:564"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:564: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:564"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:564"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:565: grep -c '^class YYParser implements Cloneable\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^class YYParser implements Cloneable$' YYParser.java" "java.at:565"
( $at_check_trace; grep -c '^class YYParser implements Cloneable$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:565"
$at_failed && at_fn_log_failure
$at_traceon; }




cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table

%define extends "Thread"
%define implements "Cloneable"
%%
start: "end" {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:567: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:567"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:567"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:567: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:567"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:567"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:567: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:567"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:567"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:567: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:567"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:567"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:567: bison YYParser.y"
at_fn_check_prepare_trace "java.at:567"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:567"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:567: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:567"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:567"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:567: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:567"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:567"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:567: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:567"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:567"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:570: grep -c '^class YYParser extends Thread implements Cloneable\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^class YYParser extends Thread implements Cloneable$' YYParser.java" "java.at:570"
( $at_check_trace; grep -c '^class YYParser extends Thread implements Cloneable$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:570"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_210
#AT_START_211
# 211. java.at:579: Java %parse-param and %lex-param
at_setup_line='java.at:579'
at_fn_banner 19
at_desc="Java %parse-param and %lex-param"
at_desc_line="211: $at_desc               "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "211. java.at:579: testing ..."
  $at_traceon



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table

%%
start: "end" {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:581: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:581"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:581"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:581: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:581"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:581"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:581: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:581"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:581"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:581: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:581"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:581"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:581: bison YYParser.y"
at_fn_check_prepare_trace "java.at:581"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:581"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:581: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:581"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:581"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:581: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:581"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:581"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:581: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:581"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:581"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:582: grep -c '^ *public YYParser (Lexer yylexer) {\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public YYParser (Lexer yylexer) {$' YYParser.java" "java.at:582"
( $at_check_trace; grep -c '^ *public YYParser (Lexer yylexer) {$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:582"
$at_failed && at_fn_log_failure
$at_traceon; }




cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%parse-param {int parse_param1}
%%
start: "end" {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:584: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:584"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:584"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:584: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:584"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:584"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:584: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:584"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:584"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:584: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:584"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:584"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:584: bison YYParser.y"
at_fn_check_prepare_trace "java.at:584"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:584"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:584: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:584"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:584"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:584: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:584"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:584"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:584: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:584"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:584"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:585: grep -c '^ *protected final int parse_param1;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *protected final int parse_param1;$' YYParser.java" "java.at:585"
( $at_check_trace; grep -c '^ *protected final int parse_param1;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:585"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:586: grep -c '^ *public YYParser (Lexer yylexer, *int parse_param1) {\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public YYParser (Lexer yylexer, *int parse_param1) {$' YYParser.java" "java.at:586"
( $at_check_trace; grep -c '^ *public YYParser (Lexer yylexer, *int parse_param1) {$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:586"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:587: grep -c '^[ 	]*this.parse_param1 = parse_param1;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^[ 	]*this.parse_param1 = parse_param1;$' YYParser.java" "java.at:587"
( $at_check_trace; grep -c '^[ 	]*this.parse_param1 = parse_param1;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:587"
$at_failed && at_fn_log_failure
$at_traceon; }




cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table

%parse-param {int parse_param1}
%parse-param {long parse_param2}
%%
start: "end" {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:589: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:589"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:589"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:589: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:589"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:589"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:589: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:589"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:589"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:589: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:589"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:589"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:589: bison YYParser.y"
at_fn_check_prepare_trace "java.at:589"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:589"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:589: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:589"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:589"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:589: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:589"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:589"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:589: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:589"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:589"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:592: grep -c '^ *protected final int parse_param1;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *protected final int parse_param1;$' YYParser.java" "java.at:592"
( $at_check_trace; grep -c '^ *protected final int parse_param1;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:592"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:593: grep -c '^ *protected final long parse_param2;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *protected final long parse_param2;$' YYParser.java" "java.at:593"
( $at_check_trace; grep -c '^ *protected final long parse_param2;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:593"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:594: grep -c '^ *public YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) {\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) {$' YYParser.java" "java.at:594"
( $at_check_trace; grep -c '^ *public YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) {$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:594"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:595: grep -c '^[ 	]*this.parse_param1 = parse_param1;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^[ 	]*this.parse_param1 = parse_param1;$' YYParser.java" "java.at:595"
( $at_check_trace; grep -c '^[ 	]*this.parse_param1 = parse_param1;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:595"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:596: grep -c '^[ 	]*this.parse_param2 = parse_param2;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^[ 	]*this.parse_param2 = parse_param2;$' YYParser.java" "java.at:596"
( $at_check_trace; grep -c '^[ 	]*this.parse_param2 = parse_param2;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:596"
$at_failed && at_fn_log_failure
$at_traceon; }




cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table


%code lexer
{
  Object yylval;
  public Object getLVal() { return yylval; }

  public Position getStartPos() { return null; }
  public Position getEndPos()   { return null; }

  public void yyerror (Location loc, String s)
  {
    System.err.println (loc + ": " + s);
  }

  public int yylex ()
  {
    return EOF;
  }


}
%%
start: "end" {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:598: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:598"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:598"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:598: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:598"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:598"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:598: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:598"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:598"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:598: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:598"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:598"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:598: bison YYParser.y"
at_fn_check_prepare_trace "java.at:598"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:598"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:598: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:598"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:598"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:598: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:598"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:598"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:598: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:598"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:598"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:599: grep -c '^ *public YYParser () {\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public YYParser () {$' YYParser.java" "java.at:599"
( $at_check_trace; grep -c '^ *public YYParser () {$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:599"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:600: grep -c '^ *protected YYParser (Lexer yylexer) {\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *protected YYParser (Lexer yylexer) {$' YYParser.java" "java.at:600"
( $at_check_trace; grep -c '^ *protected YYParser (Lexer yylexer) {$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:600"
$at_failed && at_fn_log_failure
$at_traceon; }




cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%parse-param {int parse_param1}

%code lexer
{
  Object yylval;
  public Object getLVal() { return yylval; }

  public Position getStartPos() { return null; }
  public Position getEndPos()   { return null; }

  public void yyerror (Location loc, String s)
  {
    System.err.println (loc + ": " + s);
  }

  public int yylex ()
  {
    return EOF;
  }


}
%%
start: "end" {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:602: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:602"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:602"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:602: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:602"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:602"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:602: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:602"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:602"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:602: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:602"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:602"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:602: bison YYParser.y"
at_fn_check_prepare_trace "java.at:602"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:602"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:602: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:602"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:602"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:602: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:602"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:602"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:602: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:602"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:602"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:604: grep -c '^ *protected final int parse_param1;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *protected final int parse_param1;$' YYParser.java" "java.at:604"
( $at_check_trace; grep -c '^ *protected final int parse_param1;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:604"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:605: grep -c '^ *public YYParser (int parse_param1) {\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public YYParser (int parse_param1) {$' YYParser.java" "java.at:605"
( $at_check_trace; grep -c '^ *public YYParser (int parse_param1) {$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:605"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:606: grep -c '^ *protected YYParser (Lexer yylexer, *int parse_param1) {\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *protected YYParser (Lexer yylexer, *int parse_param1) {$' YYParser.java" "java.at:606"
( $at_check_trace; grep -c '^ *protected YYParser (Lexer yylexer, *int parse_param1) {$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:606"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:607: grep -c '^[ 	]*this.parse_param1 = parse_param1;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^[ 	]*this.parse_param1 = parse_param1;$' YYParser.java" "java.at:607"
( $at_check_trace; grep -c '^[ 	]*this.parse_param1 = parse_param1;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:607"
$at_failed && at_fn_log_failure
$at_traceon; }




cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table

%parse-param {int parse_param1}
%parse-param {long parse_param2}

%code lexer
{
  Object yylval;
  public Object getLVal() { return yylval; }

  public Position getStartPos() { return null; }
  public Position getEndPos()   { return null; }

  public void yyerror (Location loc, String s)
  {
    System.err.println (loc + ": " + s);
  }

  public int yylex ()
  {
    return EOF;
  }


}
%%
start: "end" {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:609: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:609"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:609"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:609: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:609"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:609"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:609: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:609"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:609"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:609: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:609"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:609"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:609: bison YYParser.y"
at_fn_check_prepare_trace "java.at:609"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:609"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:609: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:609"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:609"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:609: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:609"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:609"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:609: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:609"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:609"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:613: grep -c '^ *protected final int parse_param1;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *protected final int parse_param1;$' YYParser.java" "java.at:613"
( $at_check_trace; grep -c '^ *protected final int parse_param1;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:613"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:614: grep -c '^ *protected final long parse_param2;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *protected final long parse_param2;$' YYParser.java" "java.at:614"
( $at_check_trace; grep -c '^ *protected final long parse_param2;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:614"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:615: grep -c '^ *public YYParser (int parse_param1, *long parse_param2) {\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public YYParser (int parse_param1, *long parse_param2) {$' YYParser.java" "java.at:615"
( $at_check_trace; grep -c '^ *public YYParser (int parse_param1, *long parse_param2) {$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:615"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:616: grep -c '^ *protected YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) {\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *protected YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) {$' YYParser.java" "java.at:616"
( $at_check_trace; grep -c '^ *protected YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) {$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:616"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:617: grep -c '^[ 	]*this.parse_param1 = parse_param1;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^[ 	]*this.parse_param1 = parse_param1;$' YYParser.java" "java.at:617"
( $at_check_trace; grep -c '^[ 	]*this.parse_param1 = parse_param1;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:617"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:618: grep -c '^[ 	]*this.parse_param2 = parse_param2;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^[ 	]*this.parse_param2 = parse_param2;$' YYParser.java" "java.at:618"
( $at_check_trace; grep -c '^[ 	]*this.parse_param2 = parse_param2;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:618"
$at_failed && at_fn_log_failure
$at_traceon; }




cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table
%lex-param {char lex_param1}

%code lexer
{
  Object yylval;
  public Object getLVal() { return yylval; }

  public Position getStartPos() { return null; }
  public Position getEndPos()   { return null; }

  public void yyerror (Location loc, String s)
  {
    System.err.println (loc + ": " + s);
  }

  public int yylex ()
  {
    return EOF;
  }

  YYLexer (char lex_param1) {}
}
%%
start: "end" {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:620: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:620"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:620: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:620"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:620: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:620"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:620: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:620"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:620: bison YYParser.y"
at_fn_check_prepare_trace "java.at:620"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:620: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:620"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:620: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:620"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:620: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:620"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:620"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:622: grep -c '^ *public YYParser (char lex_param1) {\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public YYParser (char lex_param1) {$' YYParser.java" "java.at:622"
( $at_check_trace; grep -c '^ *public YYParser (char lex_param1) {$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:622"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:623: grep -c '^.* = new YYLexer *(lex_param1);\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^.* = new YYLexer *(lex_param1);$' YYParser.java" "java.at:623"
( $at_check_trace; grep -c '^.* = new YYLexer *(lex_param1);$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:623"
$at_failed && at_fn_log_failure
$at_traceon; }




cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table

%lex-param {char lex_param1}
%lex-param {short lex_param2}

%code lexer
{
  Object yylval;
  public Object getLVal() { return yylval; }

  public Position getStartPos() { return null; }
  public Position getEndPos()   { return null; }

  public void yyerror (Location loc, String s)
  {
    System.err.println (loc + ": " + s);
  }

  public int yylex ()
  {
    return EOF;
  }

  YYLexer (char lex_param1, short lex_param2) {}
}
%%
start: "end" {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:625: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:625"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:625"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:625: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:625"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:625"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:625: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:625"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:625"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:625: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:625"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:625"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:625: bison YYParser.y"
at_fn_check_prepare_trace "java.at:625"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:625"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:625: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:625"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:625"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:625: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:625"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:625"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:625: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:625"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:625"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:629: grep -c '^ *public YYParser (char lex_param1, *short lex_param2) {\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public YYParser (char lex_param1, *short lex_param2) {$' YYParser.java" "java.at:629"
( $at_check_trace; grep -c '^ *public YYParser (char lex_param1, *short lex_param2) {$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:629"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:630: grep -c '^.* = new YYLexer *(lex_param1, *lex_param2);\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^.* = new YYLexer *(lex_param1, *lex_param2);$' YYParser.java" "java.at:630"
( $at_check_trace; grep -c '^.* = new YYLexer *(lex_param1, *lex_param2);$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:630"
$at_failed && at_fn_log_failure
$at_traceon; }




cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table

%parse-param {int parse_param1}
%parse-param {long parse_param2}
%lex-param {char lex_param1}
%lex-param {short lex_param2}

%code lexer
{
  Object yylval;
  public Object getLVal() { return yylval; }

  public Position getStartPos() { return null; }
  public Position getEndPos()   { return null; }

  public void yyerror (Location loc, String s)
  {
    System.err.println (loc + ": " + s);
  }

  public int yylex ()
  {
    return EOF;
  }

  YYLexer (char lex_param1, short lex_param2) {}
}
%%
start: "end" {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:632: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:632"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:632"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:632: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:632"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:632"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:632: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:632"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:632"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:632: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:632"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:632"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:632: bison YYParser.y"
at_fn_check_prepare_trace "java.at:632"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:632"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:632: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:632"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:632"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:632: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:632"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:632"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:632: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:632"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:632"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:638: grep -c '^ *protected final int parse_param1;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *protected final int parse_param1;$' YYParser.java" "java.at:638"
( $at_check_trace; grep -c '^ *protected final int parse_param1;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:638"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:639: grep -c '^ *protected final long parse_param2;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *protected final long parse_param2;$' YYParser.java" "java.at:639"
( $at_check_trace; grep -c '^ *protected final long parse_param2;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:639"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:640: grep -c '^ *public YYParser (char lex_param1, *short lex_param2, *int parse_param1, *long parse_param2) {\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public YYParser (char lex_param1, *short lex_param2, *int parse_param1, *long parse_param2) {$' YYParser.java" "java.at:640"
( $at_check_trace; grep -c '^ *public YYParser (char lex_param1, *short lex_param2, *int parse_param1, *long parse_param2) {$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:640"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:641: grep -c '^.* = new YYLexer *(lex_param1, *lex_param2);\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^.* = new YYLexer *(lex_param1, *lex_param2);$' YYParser.java" "java.at:641"
( $at_check_trace; grep -c '^.* = new YYLexer *(lex_param1, *lex_param2);$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:641"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:642: grep -c '^ *protected YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) {\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *protected YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) {$' YYParser.java" "java.at:642"
( $at_check_trace; grep -c '^ *protected YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) {$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:642"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:643: grep -c '^[ 	]*this.parse_param1 = parse_param1;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^[ 	]*this.parse_param1 = parse_param1;$' YYParser.java" "java.at:643"
( $at_check_trace; grep -c '^[ 	]*this.parse_param1 = parse_param1;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:643"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:644: grep -c '^[ 	]*this.parse_param2 = parse_param2;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^[ 	]*this.parse_param2 = parse_param2;$' YYParser.java" "java.at:644"
( $at_check_trace; grep -c '^[ 	]*this.parse_param2 = parse_param2;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "2
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:644"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_211
#AT_START_212
# 212. java.at:653: Java throws specifications
at_setup_line='java.at:653'
at_fn_banner 19
at_desc="Java throws specifications"
at_desc_line="212: $at_desc                     "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "212. java.at:653: testing ..."
  $at_traceon


# %define throws	- 0 1 2
# %define lex-throws	- 0 1 2
# %code lexer		  0 1





















cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table




%%
start: "end" {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:713: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:713: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:713: bison YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:713"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *int yylex () throws java.io.IOException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *public boolean parse () throws java.io.IOException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws java.io.IOException *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table

%define throws ""


%%
start: "end" {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:713: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:713: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:713: bison YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:713"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *int yylex () throws java.io.IOException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *public boolean parse () throws java.io.IOException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws java.io.IOException *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table

%define throws "ClassNotFoundException"

%initial-action {if (true) throw new ClassNotFoundException();}
%%
start: "end" {throw new ClassNotFoundException();};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:713: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:713: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:713: bison YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:713"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *int yylex () throws java.io.IOException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table

%define throws "ClassNotFoundException, InstantiationException"

%initial-action {if (true) throw new InstantiationException();}
%%
start: "end" {throw new ClassNotFoundException();};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:713: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:713: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:713: bison YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:713"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *int yylex () throws java.io.IOException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException, InstantiationException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException, InstantiationException *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table


%define lex_throws ""

%%
start: "end" {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:713: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:713: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:713: bison YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:713"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *int yylex () *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *public boolean parse () *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *public boolean parse () *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table

%define throws ""
%define lex_throws ""

%%
start: "end" {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:713: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:713: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:713: bison YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:713"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *int yylex () *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *public boolean parse () *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *public boolean parse () *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table

%define throws "ClassNotFoundException"
%define lex_throws ""
%initial-action {if (true) throw new ClassNotFoundException();}
%%
start: "end" {throw new ClassNotFoundException();};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:713: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:713: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:713: bison YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:713"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *int yylex () *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *public boolean parse () throws ClassNotFoundException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws ClassNotFoundException *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *public boolean parse () throws ClassNotFoundException *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table

%define throws "ClassNotFoundException, InstantiationException"
%define lex_throws ""
%initial-action {if (true) throw new InstantiationException();}
%%
start: "end" {throw new ClassNotFoundException();};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:713: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:713: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:713: bison YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:713"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *int yylex () *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *public boolean parse () throws ClassNotFoundException, InstantiationException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *public boolean parse () throws ClassNotFoundException, InstantiationException *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table


%define lex_throws "InterruptedException"

%%
start: "end" {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:713: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:713: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:713: bison YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:713"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *public boolean parse () throws InterruptedException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table

%define throws ""
%define lex_throws "InterruptedException"

%%
start: "end" {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:713: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:713: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:713: bison YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:713"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *public boolean parse () throws InterruptedException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table

%define throws "ClassNotFoundException"
%define lex_throws "InterruptedException"
%initial-action {if (true) throw new ClassNotFoundException();}
%%
start: "end" {throw new ClassNotFoundException();};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:713: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:713: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:713: bison YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:713"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table

%define throws "ClassNotFoundException, InstantiationException"
%define lex_throws "InterruptedException"
%initial-action {if (true) throw new InstantiationException();}
%%
start: "end" {throw new ClassNotFoundException();};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:713: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:713: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:713: bison YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:713"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException, InstantiationException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException, InstantiationException *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table


%define lex_throws "InterruptedException, IllegalAccessException"

%%
start: "end" {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:713: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:713: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:713: bison YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:713"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table

%define throws ""
%define lex_throws "InterruptedException, IllegalAccessException"

%%
start: "end" {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:713: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:713: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:713: bison YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:713"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table

%define throws "ClassNotFoundException"
%define lex_throws "InterruptedException, IllegalAccessException"
%initial-action {if (true) throw new ClassNotFoundException();}
%%
start: "end" {throw new ClassNotFoundException();};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:713: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:713: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:713: bison YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:713"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table

%define throws "ClassNotFoundException, InstantiationException"
%define lex_throws "InterruptedException, IllegalAccessException"
%initial-action {if (true) throw new InstantiationException();}
%%
start: "end" {throw new ClassNotFoundException();};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:713: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:713: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:713: bison YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:713"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException, InstantiationException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException, InstantiationException *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table





%code lexer
{
  Object yylval;
  public Object getLVal() { return yylval; }

  public Position getStartPos() { return null; }
  public Position getEndPos()   { return null; }

  public void yyerror (Location loc, String s)
  {
    System.err.println (loc + ": " + s);
  }

  public int yylex () throws java.io.IOException
  {
    throw new java.io.IOException();
  }


}
%%
start: "end" {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:713: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:713: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:713: bison YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:713"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *int yylex () throws java.io.IOException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *public boolean parse () throws java.io.IOException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws java.io.IOException *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table

%define throws ""



%code lexer
{
  Object yylval;
  public Object getLVal() { return yylval; }

  public Position getStartPos() { return null; }
  public Position getEndPos()   { return null; }

  public void yyerror (Location loc, String s)
  {
    System.err.println (loc + ": " + s);
  }

  public int yylex () throws java.io.IOException
  {
    throw new java.io.IOException();
  }


}
%%
start: "end" {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:713: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:713: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:713: bison YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:713"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *int yylex () throws java.io.IOException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *public boolean parse () throws java.io.IOException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws java.io.IOException *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table

%define throws "ClassNotFoundException"

%initial-action {if (true) throw new ClassNotFoundException();}

%code lexer
{
  Object yylval;
  public Object getLVal() { return yylval; }

  public Position getStartPos() { return null; }
  public Position getEndPos()   { return null; }

  public void yyerror (Location loc, String s)
  {
    System.err.println (loc + ": " + s);
  }

  public int yylex () throws java.io.IOException
  {
    throw new java.io.IOException();
  }


}
%%
start: "end" {throw new ClassNotFoundException();};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:713: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:713: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:713: bison YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:713"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *int yylex () throws java.io.IOException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table

%define throws "ClassNotFoundException, InstantiationException"

%initial-action {if (true) throw new InstantiationException();}

%code lexer
{
  Object yylval;
  public Object getLVal() { return yylval; }

  public Position getStartPos() { return null; }
  public Position getEndPos()   { return null; }

  public void yyerror (Location loc, String s)
  {
    System.err.println (loc + ": " + s);
  }

  public int yylex () throws java.io.IOException
  {
    throw new java.io.IOException();
  }


}
%%
start: "end" {throw new ClassNotFoundException();};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:713: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:713: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:713: bison YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:713"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *int yylex () throws java.io.IOException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException, InstantiationException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException, InstantiationException *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table


%define lex_throws ""


%code lexer
{
  Object yylval;
  public Object getLVal() { return yylval; }

  public Position getStartPos() { return null; }
  public Position getEndPos()   { return null; }

  public void yyerror (Location loc, String s)
  {
    System.err.println (loc + ": " + s);
  }

  public int yylex ()
  {
    return EOF;
  }


}
%%
start: "end" {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:713: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:713: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:713: bison YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:713"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *int yylex () *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *public boolean parse () *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *public boolean parse () *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table

%define throws ""
%define lex_throws ""


%code lexer
{
  Object yylval;
  public Object getLVal() { return yylval; }

  public Position getStartPos() { return null; }
  public Position getEndPos()   { return null; }

  public void yyerror (Location loc, String s)
  {
    System.err.println (loc + ": " + s);
  }

  public int yylex ()
  {
    return EOF;
  }


}
%%
start: "end" {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:713: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:713: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:713: bison YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:713"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *int yylex () *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *public boolean parse () *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *public boolean parse () *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table

%define throws "ClassNotFoundException"
%define lex_throws ""
%initial-action {if (true) throw new ClassNotFoundException();}

%code lexer
{
  Object yylval;
  public Object getLVal() { return yylval; }

  public Position getStartPos() { return null; }
  public Position getEndPos()   { return null; }

  public void yyerror (Location loc, String s)
  {
    System.err.println (loc + ": " + s);
  }

  public int yylex ()
  {
    return EOF;
  }


}
%%
start: "end" {throw new ClassNotFoundException();};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:713: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:713: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:713: bison YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:713"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *int yylex () *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *public boolean parse () throws ClassNotFoundException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws ClassNotFoundException *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *public boolean parse () throws ClassNotFoundException *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table

%define throws "ClassNotFoundException, InstantiationException"
%define lex_throws ""
%initial-action {if (true) throw new InstantiationException();}

%code lexer
{
  Object yylval;
  public Object getLVal() { return yylval; }

  public Position getStartPos() { return null; }
  public Position getEndPos()   { return null; }

  public void yyerror (Location loc, String s)
  {
    System.err.println (loc + ": " + s);
  }

  public int yylex ()
  {
    return EOF;
  }


}
%%
start: "end" {throw new ClassNotFoundException();};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:713: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:713: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:713: bison YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:713"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *int yylex () *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *public boolean parse () throws ClassNotFoundException, InstantiationException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *public boolean parse () throws ClassNotFoundException, InstantiationException *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table


%define lex_throws "InterruptedException"


%code lexer
{
  Object yylval;
  public Object getLVal() { return yylval; }

  public Position getStartPos() { return null; }
  public Position getEndPos()   { return null; }

  public void yyerror (Location loc, String s)
  {
    System.err.println (loc + ": " + s);
  }

  public int yylex () throws InterruptedException
  {
    throw new InterruptedException();
  }


}
%%
start: "end" {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:713: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:713: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:713: bison YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:713"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *public boolean parse () throws InterruptedException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table

%define throws ""
%define lex_throws "InterruptedException"


%code lexer
{
  Object yylval;
  public Object getLVal() { return yylval; }

  public Position getStartPos() { return null; }
  public Position getEndPos()   { return null; }

  public void yyerror (Location loc, String s)
  {
    System.err.println (loc + ": " + s);
  }

  public int yylex () throws InterruptedException
  {
    throw new InterruptedException();
  }


}
%%
start: "end" {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:713: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:713: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:713: bison YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:713"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *public boolean parse () throws InterruptedException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table

%define throws "ClassNotFoundException"
%define lex_throws "InterruptedException"
%initial-action {if (true) throw new ClassNotFoundException();}

%code lexer
{
  Object yylval;
  public Object getLVal() { return yylval; }

  public Position getStartPos() { return null; }
  public Position getEndPos()   { return null; }

  public void yyerror (Location loc, String s)
  {
    System.err.println (loc + ": " + s);
  }

  public int yylex () throws InterruptedException
  {
    throw new InterruptedException();
  }


}
%%
start: "end" {throw new ClassNotFoundException();};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:713: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:713: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:713: bison YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:713"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table

%define throws "ClassNotFoundException, InstantiationException"
%define lex_throws "InterruptedException"
%initial-action {if (true) throw new InstantiationException();}

%code lexer
{
  Object yylval;
  public Object getLVal() { return yylval; }

  public Position getStartPos() { return null; }
  public Position getEndPos()   { return null; }

  public void yyerror (Location loc, String s)
  {
    System.err.println (loc + ": " + s);
  }

  public int yylex () throws InterruptedException
  {
    throw new InterruptedException();
  }


}
%%
start: "end" {throw new ClassNotFoundException();};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:713: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:713: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:713: bison YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:713"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException, InstantiationException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException, InstantiationException *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table


%define lex_throws "InterruptedException, IllegalAccessException"


%code lexer
{
  Object yylval;
  public Object getLVal() { return yylval; }

  public Position getStartPos() { return null; }
  public Position getEndPos()   { return null; }

  public void yyerror (Location loc, String s)
  {
    System.err.println (loc + ": " + s);
  }

  public int yylex () throws InterruptedException, IllegalAccessException
  {
    throw new IllegalAccessException();
  }


}
%%
start: "end" {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:713: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:713: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:713: bison YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:713"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table

%define throws ""
%define lex_throws "InterruptedException, IllegalAccessException"


%code lexer
{
  Object yylval;
  public Object getLVal() { return yylval; }

  public Position getStartPos() { return null; }
  public Position getEndPos()   { return null; }

  public void yyerror (Location loc, String s)
  {
    System.err.println (loc + ": " + s);
  }

  public int yylex () throws InterruptedException, IllegalAccessException
  {
    throw new IllegalAccessException();
  }


}
%%
start: "end" {};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:713: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:713: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:713: bison YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:713"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table

%define throws "ClassNotFoundException"
%define lex_throws "InterruptedException, IllegalAccessException"
%initial-action {if (true) throw new ClassNotFoundException();}

%code lexer
{
  Object yylval;
  public Object getLVal() { return yylval; }

  public Position getStartPos() { return null; }
  public Position getEndPos()   { return null; }

  public void yyerror (Location loc, String s)
  {
    System.err.println (loc + ": " + s);
  }

  public int yylex () throws InterruptedException, IllegalAccessException
  {
    throw new IllegalAccessException();
  }


}
%%
start: "end" {throw new ClassNotFoundException();};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:713: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:713: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:713: bison YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:713"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table

%define throws "ClassNotFoundException, InstantiationException"
%define lex_throws "InterruptedException, IllegalAccessException"
%initial-action {if (true) throw new InstantiationException();}

%code lexer
{
  Object yylval;
  public Object getLVal() { return yylval; }

  public Position getStartPos() { return null; }
  public Position getEndPos()   { return null; }

  public void yyerror (Location loc, String s)
  {
    System.err.println (loc + ": " + s);
  }

  public int yylex () throws InterruptedException, IllegalAccessException
  {
    throw new IllegalAccessException();
  }


}
%%
start: "end" {throw new ClassNotFoundException();};
%%
class Position {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:713: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:713: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:713: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:713"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:713: bison YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:713"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:713"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:713: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:713"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:713: grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException, InstantiationException *\$' YYParser.java"
at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException, InstantiationException *$' YYParser.java" "java.at:713"
( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException, InstantiationException *$' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "1
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:713"
$at_failed && at_fn_log_failure
$at_traceon; }




  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_212
#AT_START_213
# 213. java.at:742: Java stype, position_class and location_class
at_setup_line='java.at:742'
at_fn_banner 19
at_desc="Java stype, position_class and location_class"
at_desc_line="213: $at_desc  "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "213. java.at:742: testing ..."
  $at_traceon



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table

%define stype "java.awt.Color"
%type<java.awt.Color> start;
%define location_type "MyLoc"
%define position_type "MyPos"
%code { class MyPos {} }
%%
start: "end" {$$ = $<java.awt.Color>1;};
%%
class MyPos {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:744: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:744"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:744"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:744: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:744"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:744"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:744: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:744"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:744"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:744: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:744"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:744"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:744: bison YYParser.y"
at_fn_check_prepare_trace "java.at:744"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:744"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:744: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:744"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:744"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:744: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:744"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:744"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:744: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:744"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:744"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:750: grep 'java.awt.Color' YYParser.java"
at_fn_check_prepare_trace "java.at:750"
( $at_check_trace; grep 'java.awt.Color' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:750"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:751: \$EGREP -v ' */?\\*' YYParser.java | grep 'Position'"
at_fn_check_prepare_dynamic "$EGREP -v ' */?\\*' YYParser.java | grep 'Position'" "java.at:751"
( $at_check_trace; $EGREP -v ' */?\*' YYParser.java | grep 'Position'
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:751"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:752: \$EGREP -v ' */?\\*' YYParser.java | grep 'Location'"
at_fn_check_prepare_dynamic "$EGREP -v ' */?\\*' YYParser.java | grep 'Location'" "java.at:752"
( $at_check_trace; $EGREP -v ' */?\*' YYParser.java | grep 'Location'
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:752"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >YYParser.y <<'_ATEOF'

%language "Java"
%locations
%debug
%error-verbose
%token-table

%define stype "java.awt.Color"
%type<java.awt.Color> start;
%define location_type "MyLoc"
%define position_type "MyPos"
%code { class MyPos {} }

%code lexer
{
  java.awt.Color yylval;
  public java.awt.Color getLVal() { return yylval; }

  public MyPos getStartPos() { return null; }
  public MyPos getEndPos()   { return null; }

  public void yyerror (MyLoc loc, String s)
  {
    System.err.println (loc + ": " + s);
  }

  public int yylex ()
  {
    return EOF;
  }


}
%%
start: "end" {$$ = $<java.awt.Color>1;};
%%
class MyPos {}
_ATEOF

if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/java.at:754: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot YYParser.y"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:754"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:754"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/java.at:754: bison --xml=xml-tests/test.xml YYParser.y"
at_fn_check_prepare_trace "java.at:754"
( $at_check_trace; bison --xml=xml-tests/test.xml YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:754"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/java.at:754: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:754"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:754"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/java.at:754: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:754"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:754"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/java.at:754: bison YYParser.y"
at_fn_check_prepare_trace "java.at:754"
( $at_check_trace; bison YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:754"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:754: grep '[mb]4_' YYParser.y"
at_fn_check_prepare_trace "java.at:754"
( $at_check_trace; grep '[mb]4_' YYParser.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:754"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:754: test -n \"\$CONF_JAVA\" || exit 77
test -n \"\$CONF_JAVAC\" || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "java.at:754"
( $at_check_trace; test -n "$CONF_JAVA" || exit 77
test -n "$CONF_JAVAC" || exit 77
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/java.at:754"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:754: \$SHELL ../../../javacomp.sh YYParser.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:754"
( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:754"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/java.at:762: grep 'java.awt.Color' YYParser.java"
at_fn_check_prepare_trace "java.at:762"
( $at_check_trace; grep 'java.awt.Color' YYParser.java
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/java.at:762"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:763: \$EGREP -v ' */?\\*' YYParser.java | grep 'Position'"
at_fn_check_prepare_dynamic "$EGREP -v ' */?\\*' YYParser.java | grep 'Position'" "java.at:763"
( $at_check_trace; $EGREP -v ' */?\*' YYParser.java | grep 'Position'
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:763"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/java.at:764: \$EGREP -v ' */?\\*' YYParser.java | grep 'Location'"
at_fn_check_prepare_dynamic "$EGREP -v ' */?\\*' YYParser.java | grep 'Location'" "java.at:764"
( $at_check_trace; $EGREP -v ' */?\*' YYParser.java | grep 'Location'
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/java.at:764"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_213
#AT_START_214
# 214. cxx-type.at:412: GLR: Resolve ambiguity, impure, no locations
at_setup_line='cxx-type.at:412'
at_fn_banner 20
at_desc="GLR: Resolve ambiguity, impure, no locations"
at_desc_line="214: $at_desc   "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "214. cxx-type.at:412: testing ..."
  $at_traceon







# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.












cat >types.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Simplified C++ Type and Expression Grammar.  */



%{
  #include <stdio.h>
  union Node {
    struct {
      int isNterm;
      int parents;
    } nodeInfo;
    struct {
      int isNterm; /* 1 */
      int parents;
      char const *form;
      union Node *children[3];
    } nterm;
    struct {
      int isNterm; /* 0 */
      int parents;
      char *text;
    } term;
  };
  typedef union Node Node;
  static Node *new_nterm (char const *, Node *, Node *, Node *);
  static Node *new_term (char *);
  static void free_node (Node *);
  static char *node_to_string (Node *);
  #define YYSTYPE Node *

  #define YYINITDEPTH 10
  #define YYSTACKEXPANDABLE 1
  struct YYLTYPE;
#if YYPURE
# if YYLSP_NEEDED
#  define LEX_PARAMETERS YYSTYPE *lvalp, struct YYLTYPE *llocp
#  define ERROR_PARAMETERS struct YYLTYPE *llocp, char const *s
# else
#  define LEX_PARAMETERS YYSTYPE *lvalp
# endif
#endif
#ifndef LEX_PARAMETERS
# define LEX_PARAMETERS void
#endif
#ifndef ERROR_PARAMETERS
# define ERROR_PARAMETERS char const *s
#endif
  int yylex (LEX_PARAMETERS);
  void yyerror (ERROR_PARAMETERS);
%}

%token TYPENAME ID

%right '='
%left '+'

%glr-parser

%destructor { free_node ($$); } stmt expr decl declarator TYPENAME ID

%%

prog :
     | prog stmt   {
			char *output;
			output = node_to_string ($2);
			printf ("%s\n", output);
			free (output);
			free_node ($2);
		   }
     ;

stmt : expr ';'  %dprec 1	{ $$ = $1; }
     | decl      %dprec 2
     | error ';'	{ $$ = new_nterm ("<error>", 0, 0, 0); }
     | '@'		{ YYACCEPT; }
     ;

expr : ID
     | TYPENAME '(' expr ')'
			{ $$ = new_nterm ("<cast>(%s,%s)", $3, $1, 0); }
     | expr '+' expr	{ $$ = new_nterm ("+(%s,%s)", $1, $3, 0); }
     | expr '=' expr    { $$ = new_nterm ("=(%s,%s)", $1, $3, 0); }
     ;

decl : TYPENAME declarator ';'
			{ $$ = new_nterm ("<declare>(%s,%s)", $1, $2, 0); }
     | TYPENAME declarator '=' expr ';'
			{ $$ = new_nterm ("<init-declare>(%s,%s,%s)", $1,
					  $2, $4); }
     ;

declarator : ID
     | '(' declarator ')' { $$ = $2; }
     ;

%%

#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>

int
main (int argc, char **argv)
{
  if (argc != 2)
    abort ();
  if (!freopen (argv[1], "r", stdin))
    return 3;
  return yyparse ();
}

int
yylex (LEX_PARAMETERS)
{
  char buffer[256];
  int c;
  unsigned int i;
  static int lineNum = 1;
  static int colNum = 0;

#if YYPURE
# undef yylloc
# define yylloc (*llocp)
# undef yylval
# define yylval (*lvalp)
#endif

  while (1)
    {
      if (feof (stdin))
	abort ();
      c = getchar ();
      switch (c)
	{
	case EOF:
	  return 0;
	case '\t':
	  colNum = (colNum + 7) & ~7;
	  break;
	case ' ': case '\f':
	  colNum += 1;
	  break;
	case '\n':
	  lineNum += 1;
	  colNum = 0;
	  break;
	default:
	  {
	    int tok;
#if YYLSP_NEEDED
	    yylloc.first_line = yylloc.last_line = lineNum;
	    yylloc.first_column = colNum;
#endif
	    if (isalpha (c))
	      {
		i = 0;

		do
		  {
		    buffer[i++] = c;
		    colNum += 1;
		    if (i == sizeof buffer - 1)
		      abort ();
		    c = getchar ();
		  }
		while (isalnum (c) || c == '_');

		ungetc (c, stdin);
		buffer[i++] = 0;
		tok = isupper ((unsigned char) buffer[0]) ? TYPENAME : ID;
		yylval = new_term (strcpy ((char *) malloc (i), buffer));
	      }
	    else
	      {
		colNum += 1;
		tok = c;
		yylval = 0;
	      }
#if YYLSP_NEEDED
	    yylloc.last_column = colNum-1;
#endif
	    return tok;
	  }
	}
    }
}

void
yyerror (ERROR_PARAMETERS)
{
#if YYPURE && YYLSP_NEEDED
  /* Pacify GCC by using llocp.  */
  if (! llocp)
    abort ();
#endif
  fprintf (stderr, "%s\n", s);
}

static Node *
new_nterm (char const *form, Node *child0, Node *child1, Node *child2)
{
  Node *node = (Node *) malloc (sizeof (Node));
  node->nterm.isNterm = 1;
  node->nterm.parents = 0;
  node->nterm.form = form;
  node->nterm.children[0] = child0;
  if (child0)
    child0->nodeInfo.parents += 1;
  node->nterm.children[1] = child1;
  if (child1)
    child1->nodeInfo.parents += 1;
  node->nterm.children[2] = child2;
  if (child2)
    child2->nodeInfo.parents += 1;
  return node;
}

static Node *
new_term (char *text)
{
  Node *node = (Node *) malloc (sizeof (Node));
  node->term.isNterm = 0;
  node->term.parents = 0;
  node->term.text = text;
  return node;
}

static void
free_node (Node *node)
{
  if (!node)
    return;
  node->nodeInfo.parents -= 1;
  /* Free only if 0 (last parent) or -1 (no parents).  */
  if (node->nodeInfo.parents > 0)
    return;
  if (node->nodeInfo.isNterm == 1)
    {
      free_node (node->nterm.children[0]);
      free_node (node->nterm.children[1]);
      free_node (node->nterm.children[2]);
    }
  else
    free (node->term.text);
  free (node);
}

static char *
node_to_string (Node *node)
{
  char *child0;
  char *child1;
  char *child2;
  char *buffer;
  if (!node)
    {
      buffer = (char *) malloc (1);
      buffer[0] = 0;
    }
  else if (node->nodeInfo.isNterm == 1)
    {
      child0 = node_to_string (node->nterm.children[0]);
      child1 = node_to_string (node->nterm.children[1]);
      child2 = node_to_string (node->nterm.children[2]);
      buffer = (char *) malloc (strlen (node->nterm.form) + strlen (child0)
				+ strlen (child1) + strlen (child2) + 1);
      sprintf (buffer, node->nterm.form, child0, child1, child2);
      free (child0);
      free (child1);
      free (child2);
    }
  else
    buffer = strdup (node->term.text);
  return buffer;
}



_ATEOF



cat >test-input <<'_ATEOF'


z + q;

T x;

T x = y;

x = y;

T (x) + y;

T (x);

T (y) = z + q;

T (y y) = z + q;

z + q;

@

This is total garbage, but it should be ignored.
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/cxx-type.at:413: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o types.c types.y"
at_fn_check_prepare_notrace 'an embedded newline' "cxx-type.at:413"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o types.c types.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:413"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/cxx-type.at:413: bison --xml=xml-tests/test.xml -o types.c types.y"
at_fn_check_prepare_trace "cxx-type.at:413"
( $at_check_trace; bison --xml=xml-tests/test.xml -o types.c types.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:413"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/cxx-type.at:413: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:413"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:413"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/cxx-type.at:413: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:413"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:413"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/cxx-type.at:413: bison -o types.c types.y"
at_fn_check_prepare_trace "cxx-type.at:413"
( $at_check_trace; bison -o types.c types.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:413"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/cxx-type.at:413: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o types types.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS" "cxx-type.at:413"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:413"
$at_failed && at_fn_log_failure
$at_traceon; }

























{ set +x
$as_echo "$at_srcdir/cxx-type.at:415:  \$PREPARSER ./types test-input"
at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:415"
( $at_check_trace;  $PREPARSER ./types test-input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "syntax error
" | \
  $at_diff - "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "+(z,q)
<declare>(T,x)
<init-declare>(T,x,y)
=(x,y)
+(<cast>(x,T),y)
<declare>(T,x)
<init-declare>(T,y,+(z,q))
<error>
+(z,q)
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:415"
$at_failed && at_fn_log_failure
$at_traceon; }

  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_214
#AT_START_215
# 215. cxx-type.at:419: GLR: Resolve ambiguity, impure, locations
at_setup_line='cxx-type.at:419'
at_fn_banner 20
at_desc="GLR: Resolve ambiguity, impure, locations"
at_desc_line="215: $at_desc      "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "215. cxx-type.at:419: testing ..."
  $at_traceon







# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.












cat >types.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Simplified C++ Type and Expression Grammar.  */

%locations

%{
  #include <stdio.h>
  union Node {
    struct {
      int isNterm;
      int parents;
    } nodeInfo;
    struct {
      int isNterm; /* 1 */
      int parents;
      char const *form;
      union Node *children[3];
    } nterm;
    struct {
      int isNterm; /* 0 */
      int parents;
      char *text;
    } term;
  };
  typedef union Node Node;
  static Node *new_nterm (char const *, Node *, Node *, Node *);
  static Node *new_term (char *);
  static void free_node (Node *);
  static char *node_to_string (Node *);
  #define YYSTYPE Node *

  #define YYINITDEPTH 10
  #define YYSTACKEXPANDABLE 1
  struct YYLTYPE;
#if YYPURE
# if YYLSP_NEEDED
#  define LEX_PARAMETERS YYSTYPE *lvalp, struct YYLTYPE *llocp
#  define ERROR_PARAMETERS struct YYLTYPE *llocp, char const *s
# else
#  define LEX_PARAMETERS YYSTYPE *lvalp
# endif
#endif
#ifndef LEX_PARAMETERS
# define LEX_PARAMETERS void
#endif
#ifndef ERROR_PARAMETERS
# define ERROR_PARAMETERS char const *s
#endif
  int yylex (LEX_PARAMETERS);
  void yyerror (ERROR_PARAMETERS);
%}

%token TYPENAME ID

%right '='
%left '+'

%glr-parser

%destructor { free_node ($$); } stmt expr decl declarator TYPENAME ID

%%

prog :
     | prog stmt   {
			char *output;
			printf ("%d.%d-%d.%d: ",
			     @2.first_line, @2.first_column,
			     @2.last_line, @2.last_column);
			output = node_to_string ($2);
			printf ("%s\n", output);
			free (output);
			free_node ($2);
		   }
     ;

stmt : expr ';'  %dprec 1	{ $$ = $1; }
     | decl      %dprec 2
     | error ';'	{ $$ = new_nterm ("<error>", 0, 0, 0); }
     | '@'		{ YYACCEPT; }
     ;

expr : ID
     | TYPENAME '(' expr ')'
			{ $$ = new_nterm ("<cast>(%s,%s)", $3, $1, 0); }
     | expr '+' expr	{ $$ = new_nterm ("+(%s,%s)", $1, $3, 0); }
     | expr '=' expr    { $$ = new_nterm ("=(%s,%s)", $1, $3, 0); }
     ;

decl : TYPENAME declarator ';'
			{ $$ = new_nterm ("<declare>(%s,%s)", $1, $2, 0); }
     | TYPENAME declarator '=' expr ';'
			{ $$ = new_nterm ("<init-declare>(%s,%s,%s)", $1,
					  $2, $4); }
     ;

declarator : ID
     | '(' declarator ')' { $$ = $2; }
     ;

%%

#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>

int
main (int argc, char **argv)
{
  if (argc != 2)
    abort ();
  if (!freopen (argv[1], "r", stdin))
    return 3;
  return yyparse ();
}

int
yylex (LEX_PARAMETERS)
{
  char buffer[256];
  int c;
  unsigned int i;
  static int lineNum = 1;
  static int colNum = 0;

#if YYPURE
# undef yylloc
# define yylloc (*llocp)
# undef yylval
# define yylval (*lvalp)
#endif

  while (1)
    {
      if (feof (stdin))
	abort ();
      c = getchar ();
      switch (c)
	{
	case EOF:
	  return 0;
	case '\t':
	  colNum = (colNum + 7) & ~7;
	  break;
	case ' ': case '\f':
	  colNum += 1;
	  break;
	case '\n':
	  lineNum += 1;
	  colNum = 0;
	  break;
	default:
	  {
	    int tok;
#if YYLSP_NEEDED
	    yylloc.first_line = yylloc.last_line = lineNum;
	    yylloc.first_column = colNum;
#endif
	    if (isalpha (c))
	      {
		i = 0;

		do
		  {
		    buffer[i++] = c;
		    colNum += 1;
		    if (i == sizeof buffer - 1)
		      abort ();
		    c = getchar ();
		  }
		while (isalnum (c) || c == '_');

		ungetc (c, stdin);
		buffer[i++] = 0;
		tok = isupper ((unsigned char) buffer[0]) ? TYPENAME : ID;
		yylval = new_term (strcpy ((char *) malloc (i), buffer));
	      }
	    else
	      {
		colNum += 1;
		tok = c;
		yylval = 0;
	      }
#if YYLSP_NEEDED
	    yylloc.last_column = colNum-1;
#endif
	    return tok;
	  }
	}
    }
}

void
yyerror (ERROR_PARAMETERS)
{
#if YYPURE && YYLSP_NEEDED
  /* Pacify GCC by using llocp.  */
  if (! llocp)
    abort ();
#endif
  fprintf (stderr, "%s\n", s);
}

static Node *
new_nterm (char const *form, Node *child0, Node *child1, Node *child2)
{
  Node *node = (Node *) malloc (sizeof (Node));
  node->nterm.isNterm = 1;
  node->nterm.parents = 0;
  node->nterm.form = form;
  node->nterm.children[0] = child0;
  if (child0)
    child0->nodeInfo.parents += 1;
  node->nterm.children[1] = child1;
  if (child1)
    child1->nodeInfo.parents += 1;
  node->nterm.children[2] = child2;
  if (child2)
    child2->nodeInfo.parents += 1;
  return node;
}

static Node *
new_term (char *text)
{
  Node *node = (Node *) malloc (sizeof (Node));
  node->term.isNterm = 0;
  node->term.parents = 0;
  node->term.text = text;
  return node;
}

static void
free_node (Node *node)
{
  if (!node)
    return;
  node->nodeInfo.parents -= 1;
  /* Free only if 0 (last parent) or -1 (no parents).  */
  if (node->nodeInfo.parents > 0)
    return;
  if (node->nodeInfo.isNterm == 1)
    {
      free_node (node->nterm.children[0]);
      free_node (node->nterm.children[1]);
      free_node (node->nterm.children[2]);
    }
  else
    free (node->term.text);
  free (node);
}

static char *
node_to_string (Node *node)
{
  char *child0;
  char *child1;
  char *child2;
  char *buffer;
  if (!node)
    {
      buffer = (char *) malloc (1);
      buffer[0] = 0;
    }
  else if (node->nodeInfo.isNterm == 1)
    {
      child0 = node_to_string (node->nterm.children[0]);
      child1 = node_to_string (node->nterm.children[1]);
      child2 = node_to_string (node->nterm.children[2]);
      buffer = (char *) malloc (strlen (node->nterm.form) + strlen (child0)
				+ strlen (child1) + strlen (child2) + 1);
      sprintf (buffer, node->nterm.form, child0, child1, child2);
      free (child0);
      free (child1);
      free (child2);
    }
  else
    buffer = strdup (node->term.text);
  return buffer;
}



_ATEOF



cat >test-input <<'_ATEOF'


z + q;

T x;

T x = y;

x = y;

T (x) + y;

T (x);

T (y) = z + q;

T (y y) = z + q;

z + q;

@

This is total garbage, but it should be ignored.
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/cxx-type.at:420: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o types.c types.y"
at_fn_check_prepare_notrace 'an embedded newline' "cxx-type.at:420"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o types.c types.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:420"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/cxx-type.at:420: bison --xml=xml-tests/test.xml -o types.c types.y"
at_fn_check_prepare_trace "cxx-type.at:420"
( $at_check_trace; bison --xml=xml-tests/test.xml -o types.c types.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:420"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/cxx-type.at:420: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:420"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:420"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/cxx-type.at:420: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:420"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:420"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/cxx-type.at:420: bison -o types.c types.y"
at_fn_check_prepare_trace "cxx-type.at:420"
( $at_check_trace; bison -o types.c types.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:420"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/cxx-type.at:420: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o types types.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS" "cxx-type.at:420"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:420"
$at_failed && at_fn_log_failure
$at_traceon; }

























{ set +x
$as_echo "$at_srcdir/cxx-type.at:421:  \$PREPARSER ./types test-input"
at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:421"
( $at_check_trace;  $PREPARSER ./types test-input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "syntax error
" | \
  $at_diff - "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "3.0-3.5: +(z,q)
5.0-5.3: <declare>(T,x)
7.0-7.7: <init-declare>(T,x,y)
9.0-9.5: =(x,y)
11.0-11.9: +(<cast>(x,T),y)
13.0-13.5: <declare>(T,x)
15.0-15.13: <init-declare>(T,y,+(z,q))
17.0-17.15: <error>
19.0-19.5: +(z,q)
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:421"
$at_failed && at_fn_log_failure
$at_traceon; }

  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_215
#AT_START_216
# 216. cxx-type.at:425: GLR: Resolve ambiguity, pure, no locations
at_setup_line='cxx-type.at:425'
at_fn_banner 20
at_desc="GLR: Resolve ambiguity, pure, no locations"
at_desc_line="216: $at_desc     "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "216. cxx-type.at:425: testing ..."
  $at_traceon







# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.












cat >types.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Simplified C++ Type and Expression Grammar.  */

%define api.pure

%{
  #include <stdio.h>
  union Node {
    struct {
      int isNterm;
      int parents;
    } nodeInfo;
    struct {
      int isNterm; /* 1 */
      int parents;
      char const *form;
      union Node *children[3];
    } nterm;
    struct {
      int isNterm; /* 0 */
      int parents;
      char *text;
    } term;
  };
  typedef union Node Node;
  static Node *new_nterm (char const *, Node *, Node *, Node *);
  static Node *new_term (char *);
  static void free_node (Node *);
  static char *node_to_string (Node *);
  #define YYSTYPE Node *

  #define YYINITDEPTH 10
  #define YYSTACKEXPANDABLE 1
  struct YYLTYPE;
#if YYPURE
# if YYLSP_NEEDED
#  define LEX_PARAMETERS YYSTYPE *lvalp, struct YYLTYPE *llocp
#  define ERROR_PARAMETERS struct YYLTYPE *llocp, char const *s
# else
#  define LEX_PARAMETERS YYSTYPE *lvalp
# endif
#endif
#ifndef LEX_PARAMETERS
# define LEX_PARAMETERS void
#endif
#ifndef ERROR_PARAMETERS
# define ERROR_PARAMETERS char const *s
#endif
  int yylex (LEX_PARAMETERS);
  void yyerror (ERROR_PARAMETERS);
%}

%token TYPENAME ID

%right '='
%left '+'

%glr-parser

%destructor { free_node ($$); } stmt expr decl declarator TYPENAME ID

%%

prog :
     | prog stmt   {
			char *output;
			output = node_to_string ($2);
			printf ("%s\n", output);
			free (output);
			free_node ($2);
		   }
     ;

stmt : expr ';'  %dprec 1	{ $$ = $1; }
     | decl      %dprec 2
     | error ';'	{ $$ = new_nterm ("<error>", 0, 0, 0); }
     | '@'		{ YYACCEPT; }
     ;

expr : ID
     | TYPENAME '(' expr ')'
			{ $$ = new_nterm ("<cast>(%s,%s)", $3, $1, 0); }
     | expr '+' expr	{ $$ = new_nterm ("+(%s,%s)", $1, $3, 0); }
     | expr '=' expr    { $$ = new_nterm ("=(%s,%s)", $1, $3, 0); }
     ;

decl : TYPENAME declarator ';'
			{ $$ = new_nterm ("<declare>(%s,%s)", $1, $2, 0); }
     | TYPENAME declarator '=' expr ';'
			{ $$ = new_nterm ("<init-declare>(%s,%s,%s)", $1,
					  $2, $4); }
     ;

declarator : ID
     | '(' declarator ')' { $$ = $2; }
     ;

%%

#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>

int
main (int argc, char **argv)
{
  if (argc != 2)
    abort ();
  if (!freopen (argv[1], "r", stdin))
    return 3;
  return yyparse ();
}

int
yylex (LEX_PARAMETERS)
{
  char buffer[256];
  int c;
  unsigned int i;
  static int lineNum = 1;
  static int colNum = 0;

#if YYPURE
# undef yylloc
# define yylloc (*llocp)
# undef yylval
# define yylval (*lvalp)
#endif

  while (1)
    {
      if (feof (stdin))
	abort ();
      c = getchar ();
      switch (c)
	{
	case EOF:
	  return 0;
	case '\t':
	  colNum = (colNum + 7) & ~7;
	  break;
	case ' ': case '\f':
	  colNum += 1;
	  break;
	case '\n':
	  lineNum += 1;
	  colNum = 0;
	  break;
	default:
	  {
	    int tok;
#if YYLSP_NEEDED
	    yylloc.first_line = yylloc.last_line = lineNum;
	    yylloc.first_column = colNum;
#endif
	    if (isalpha (c))
	      {
		i = 0;

		do
		  {
		    buffer[i++] = c;
		    colNum += 1;
		    if (i == sizeof buffer - 1)
		      abort ();
		    c = getchar ();
		  }
		while (isalnum (c) || c == '_');

		ungetc (c, stdin);
		buffer[i++] = 0;
		tok = isupper ((unsigned char) buffer[0]) ? TYPENAME : ID;
		yylval = new_term (strcpy ((char *) malloc (i), buffer));
	      }
	    else
	      {
		colNum += 1;
		tok = c;
		yylval = 0;
	      }
#if YYLSP_NEEDED
	    yylloc.last_column = colNum-1;
#endif
	    return tok;
	  }
	}
    }
}

void
yyerror (ERROR_PARAMETERS)
{
#if YYPURE && YYLSP_NEEDED
  /* Pacify GCC by using llocp.  */
  if (! llocp)
    abort ();
#endif
  fprintf (stderr, "%s\n", s);
}

static Node *
new_nterm (char const *form, Node *child0, Node *child1, Node *child2)
{
  Node *node = (Node *) malloc (sizeof (Node));
  node->nterm.isNterm = 1;
  node->nterm.parents = 0;
  node->nterm.form = form;
  node->nterm.children[0] = child0;
  if (child0)
    child0->nodeInfo.parents += 1;
  node->nterm.children[1] = child1;
  if (child1)
    child1->nodeInfo.parents += 1;
  node->nterm.children[2] = child2;
  if (child2)
    child2->nodeInfo.parents += 1;
  return node;
}

static Node *
new_term (char *text)
{
  Node *node = (Node *) malloc (sizeof (Node));
  node->term.isNterm = 0;
  node->term.parents = 0;
  node->term.text = text;
  return node;
}

static void
free_node (Node *node)
{
  if (!node)
    return;
  node->nodeInfo.parents -= 1;
  /* Free only if 0 (last parent) or -1 (no parents).  */
  if (node->nodeInfo.parents > 0)
    return;
  if (node->nodeInfo.isNterm == 1)
    {
      free_node (node->nterm.children[0]);
      free_node (node->nterm.children[1]);
      free_node (node->nterm.children[2]);
    }
  else
    free (node->term.text);
  free (node);
}

static char *
node_to_string (Node *node)
{
  char *child0;
  char *child1;
  char *child2;
  char *buffer;
  if (!node)
    {
      buffer = (char *) malloc (1);
      buffer[0] = 0;
    }
  else if (node->nodeInfo.isNterm == 1)
    {
      child0 = node_to_string (node->nterm.children[0]);
      child1 = node_to_string (node->nterm.children[1]);
      child2 = node_to_string (node->nterm.children[2]);
      buffer = (char *) malloc (strlen (node->nterm.form) + strlen (child0)
				+ strlen (child1) + strlen (child2) + 1);
      sprintf (buffer, node->nterm.form, child0, child1, child2);
      free (child0);
      free (child1);
      free (child2);
    }
  else
    buffer = strdup (node->term.text);
  return buffer;
}



_ATEOF



cat >test-input <<'_ATEOF'


z + q;

T x;

T x = y;

x = y;

T (x) + y;

T (x);

T (y) = z + q;

T (y y) = z + q;

z + q;

@

This is total garbage, but it should be ignored.
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/cxx-type.at:426: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o types.c types.y"
at_fn_check_prepare_notrace 'an embedded newline' "cxx-type.at:426"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o types.c types.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:426"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/cxx-type.at:426: bison --xml=xml-tests/test.xml -o types.c types.y"
at_fn_check_prepare_trace "cxx-type.at:426"
( $at_check_trace; bison --xml=xml-tests/test.xml -o types.c types.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:426"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/cxx-type.at:426: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:426"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:426"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/cxx-type.at:426: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:426"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:426"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/cxx-type.at:426: bison -o types.c types.y"
at_fn_check_prepare_trace "cxx-type.at:426"
( $at_check_trace; bison -o types.c types.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:426"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/cxx-type.at:426: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o types types.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS" "cxx-type.at:426"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:426"
$at_failed && at_fn_log_failure
$at_traceon; }

























{ set +x
$as_echo "$at_srcdir/cxx-type.at:428:  \$PREPARSER ./types test-input"
at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:428"
( $at_check_trace;  $PREPARSER ./types test-input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "syntax error
" | \
  $at_diff - "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "+(z,q)
<declare>(T,x)
<init-declare>(T,x,y)
=(x,y)
+(<cast>(x,T),y)
<declare>(T,x)
<init-declare>(T,y,+(z,q))
<error>
+(z,q)
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:428"
$at_failed && at_fn_log_failure
$at_traceon; }

  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_216
#AT_START_217
# 217. cxx-type.at:432: GLR: Resolve ambiguity, pure, locations
at_setup_line='cxx-type.at:432'
at_fn_banner 20
at_desc="GLR: Resolve ambiguity, pure, locations"
at_desc_line="217: $at_desc        "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "217. cxx-type.at:432: testing ..."
  $at_traceon







# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.












cat >types.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Simplified C++ Type and Expression Grammar.  */

%define api.pure %locations

%{
  #include <stdio.h>
  union Node {
    struct {
      int isNterm;
      int parents;
    } nodeInfo;
    struct {
      int isNterm; /* 1 */
      int parents;
      char const *form;
      union Node *children[3];
    } nterm;
    struct {
      int isNterm; /* 0 */
      int parents;
      char *text;
    } term;
  };
  typedef union Node Node;
  static Node *new_nterm (char const *, Node *, Node *, Node *);
  static Node *new_term (char *);
  static void free_node (Node *);
  static char *node_to_string (Node *);
  #define YYSTYPE Node *

  #define YYINITDEPTH 10
  #define YYSTACKEXPANDABLE 1
  struct YYLTYPE;
#if YYPURE
# if YYLSP_NEEDED
#  define LEX_PARAMETERS YYSTYPE *lvalp, struct YYLTYPE *llocp
#  define ERROR_PARAMETERS struct YYLTYPE *llocp, char const *s
# else
#  define LEX_PARAMETERS YYSTYPE *lvalp
# endif
#endif
#ifndef LEX_PARAMETERS
# define LEX_PARAMETERS void
#endif
#ifndef ERROR_PARAMETERS
# define ERROR_PARAMETERS char const *s
#endif
  int yylex (LEX_PARAMETERS);
  void yyerror (ERROR_PARAMETERS);
%}

%token TYPENAME ID

%right '='
%left '+'

%glr-parser

%destructor { free_node ($$); } stmt expr decl declarator TYPENAME ID

%%

prog :
     | prog stmt   {
			char *output;
			printf ("%d.%d-%d.%d: ",
			     @2.first_line, @2.first_column,
			     @2.last_line, @2.last_column);
			output = node_to_string ($2);
			printf ("%s\n", output);
			free (output);
			free_node ($2);
		   }
     ;

stmt : expr ';'  %dprec 1	{ $$ = $1; }
     | decl      %dprec 2
     | error ';'	{ $$ = new_nterm ("<error>", 0, 0, 0); }
     | '@'		{ YYACCEPT; }
     ;

expr : ID
     | TYPENAME '(' expr ')'
			{ $$ = new_nterm ("<cast>(%s,%s)", $3, $1, 0); }
     | expr '+' expr	{ $$ = new_nterm ("+(%s,%s)", $1, $3, 0); }
     | expr '=' expr    { $$ = new_nterm ("=(%s,%s)", $1, $3, 0); }
     ;

decl : TYPENAME declarator ';'
			{ $$ = new_nterm ("<declare>(%s,%s)", $1, $2, 0); }
     | TYPENAME declarator '=' expr ';'
			{ $$ = new_nterm ("<init-declare>(%s,%s,%s)", $1,
					  $2, $4); }
     ;

declarator : ID
     | '(' declarator ')' { $$ = $2; }
     ;

%%

#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>

int
main (int argc, char **argv)
{
  if (argc != 2)
    abort ();
  if (!freopen (argv[1], "r", stdin))
    return 3;
  return yyparse ();
}

int
yylex (LEX_PARAMETERS)
{
  char buffer[256];
  int c;
  unsigned int i;
  static int lineNum = 1;
  static int colNum = 0;

#if YYPURE
# undef yylloc
# define yylloc (*llocp)
# undef yylval
# define yylval (*lvalp)
#endif

  while (1)
    {
      if (feof (stdin))
	abort ();
      c = getchar ();
      switch (c)
	{
	case EOF:
	  return 0;
	case '\t':
	  colNum = (colNum + 7) & ~7;
	  break;
	case ' ': case '\f':
	  colNum += 1;
	  break;
	case '\n':
	  lineNum += 1;
	  colNum = 0;
	  break;
	default:
	  {
	    int tok;
#if YYLSP_NEEDED
	    yylloc.first_line = yylloc.last_line = lineNum;
	    yylloc.first_column = colNum;
#endif
	    if (isalpha (c))
	      {
		i = 0;

		do
		  {
		    buffer[i++] = c;
		    colNum += 1;
		    if (i == sizeof buffer - 1)
		      abort ();
		    c = getchar ();
		  }
		while (isalnum (c) || c == '_');

		ungetc (c, stdin);
		buffer[i++] = 0;
		tok = isupper ((unsigned char) buffer[0]) ? TYPENAME : ID;
		yylval = new_term (strcpy ((char *) malloc (i), buffer));
	      }
	    else
	      {
		colNum += 1;
		tok = c;
		yylval = 0;
	      }
#if YYLSP_NEEDED
	    yylloc.last_column = colNum-1;
#endif
	    return tok;
	  }
	}
    }
}

void
yyerror (ERROR_PARAMETERS)
{
#if YYPURE && YYLSP_NEEDED
  /* Pacify GCC by using llocp.  */
  if (! llocp)
    abort ();
#endif
  fprintf (stderr, "%s\n", s);
}

static Node *
new_nterm (char const *form, Node *child0, Node *child1, Node *child2)
{
  Node *node = (Node *) malloc (sizeof (Node));
  node->nterm.isNterm = 1;
  node->nterm.parents = 0;
  node->nterm.form = form;
  node->nterm.children[0] = child0;
  if (child0)
    child0->nodeInfo.parents += 1;
  node->nterm.children[1] = child1;
  if (child1)
    child1->nodeInfo.parents += 1;
  node->nterm.children[2] = child2;
  if (child2)
    child2->nodeInfo.parents += 1;
  return node;
}

static Node *
new_term (char *text)
{
  Node *node = (Node *) malloc (sizeof (Node));
  node->term.isNterm = 0;
  node->term.parents = 0;
  node->term.text = text;
  return node;
}

static void
free_node (Node *node)
{
  if (!node)
    return;
  node->nodeInfo.parents -= 1;
  /* Free only if 0 (last parent) or -1 (no parents).  */
  if (node->nodeInfo.parents > 0)
    return;
  if (node->nodeInfo.isNterm == 1)
    {
      free_node (node->nterm.children[0]);
      free_node (node->nterm.children[1]);
      free_node (node->nterm.children[2]);
    }
  else
    free (node->term.text);
  free (node);
}

static char *
node_to_string (Node *node)
{
  char *child0;
  char *child1;
  char *child2;
  char *buffer;
  if (!node)
    {
      buffer = (char *) malloc (1);
      buffer[0] = 0;
    }
  else if (node->nodeInfo.isNterm == 1)
    {
      child0 = node_to_string (node->nterm.children[0]);
      child1 = node_to_string (node->nterm.children[1]);
      child2 = node_to_string (node->nterm.children[2]);
      buffer = (char *) malloc (strlen (node->nterm.form) + strlen (child0)
				+ strlen (child1) + strlen (child2) + 1);
      sprintf (buffer, node->nterm.form, child0, child1, child2);
      free (child0);
      free (child1);
      free (child2);
    }
  else
    buffer = strdup (node->term.text);
  return buffer;
}



_ATEOF



cat >test-input <<'_ATEOF'


z + q;

T x;

T x = y;

x = y;

T (x) + y;

T (x);

T (y) = z + q;

T (y y) = z + q;

z + q;

@

This is total garbage, but it should be ignored.
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/cxx-type.at:433: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o types.c types.y"
at_fn_check_prepare_notrace 'an embedded newline' "cxx-type.at:433"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o types.c types.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:433"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/cxx-type.at:433: bison --xml=xml-tests/test.xml -o types.c types.y"
at_fn_check_prepare_trace "cxx-type.at:433"
( $at_check_trace; bison --xml=xml-tests/test.xml -o types.c types.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:433"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/cxx-type.at:433: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:433"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:433"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/cxx-type.at:433: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:433"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:433"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/cxx-type.at:433: bison -o types.c types.y"
at_fn_check_prepare_trace "cxx-type.at:433"
( $at_check_trace; bison -o types.c types.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:433"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/cxx-type.at:433: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o types types.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS" "cxx-type.at:433"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:433"
$at_failed && at_fn_log_failure
$at_traceon; }

























{ set +x
$as_echo "$at_srcdir/cxx-type.at:435:  \$PREPARSER ./types test-input"
at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:435"
( $at_check_trace;  $PREPARSER ./types test-input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "syntax error
" | \
  $at_diff - "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "3.0-3.5: +(z,q)
5.0-5.3: <declare>(T,x)
7.0-7.7: <init-declare>(T,x,y)
9.0-9.5: =(x,y)
11.0-11.9: +(<cast>(x,T),y)
13.0-13.5: <declare>(T,x)
15.0-15.13: <init-declare>(T,y,+(z,q))
17.0-17.15: <error>
19.0-19.5: +(z,q)
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:435"
$at_failed && at_fn_log_failure
$at_traceon; }

  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_217
#AT_START_218
# 218. cxx-type.at:439: GLR: Merge conflicting parses, impure, no locations
at_setup_line='cxx-type.at:439'
at_fn_banner 20
at_desc="GLR: Merge conflicting parses, impure, no locations"
at_desc_line="218: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "218. cxx-type.at:439: testing ..."
  $at_traceon







# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.












cat >types.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Simplified C++ Type and Expression Grammar.  */



%{
  #include <stdio.h>
  union Node {
    struct {
      int isNterm;
      int parents;
    } nodeInfo;
    struct {
      int isNterm; /* 1 */
      int parents;
      char const *form;
      union Node *children[3];
    } nterm;
    struct {
      int isNterm; /* 0 */
      int parents;
      char *text;
    } term;
  };
  typedef union Node Node;
  static Node *new_nterm (char const *, Node *, Node *, Node *);
  static Node *new_term (char *);
  static void free_node (Node *);
  static char *node_to_string (Node *);
  #define YYSTYPE Node *
 static YYSTYPE stmtMerge (YYSTYPE x0, YYSTYPE x1);
  #define YYINITDEPTH 10
  #define YYSTACKEXPANDABLE 1
  struct YYLTYPE;
#if YYPURE
# if YYLSP_NEEDED
#  define LEX_PARAMETERS YYSTYPE *lvalp, struct YYLTYPE *llocp
#  define ERROR_PARAMETERS struct YYLTYPE *llocp, char const *s
# else
#  define LEX_PARAMETERS YYSTYPE *lvalp
# endif
#endif
#ifndef LEX_PARAMETERS
# define LEX_PARAMETERS void
#endif
#ifndef ERROR_PARAMETERS
# define ERROR_PARAMETERS char const *s
#endif
  int yylex (LEX_PARAMETERS);
  void yyerror (ERROR_PARAMETERS);
%}

%token TYPENAME ID

%right '='
%left '+'

%glr-parser

%destructor { free_node ($$); } stmt expr decl declarator TYPENAME ID

%%

prog :
     | prog stmt   {
			char *output;
			output = node_to_string ($2);
			printf ("%s\n", output);
			free (output);
			free_node ($2);
		   }
     ;

stmt : expr ';'  %merge <stmtMerge>	{ $$ = $1; }
     | decl      %merge <stmtMerge>
     | error ';'	{ $$ = new_nterm ("<error>", 0, 0, 0); }
     | '@'		{ YYACCEPT; }
     ;

expr : ID
     | TYPENAME '(' expr ')'
			{ $$ = new_nterm ("<cast>(%s,%s)", $3, $1, 0); }
     | expr '+' expr	{ $$ = new_nterm ("+(%s,%s)", $1, $3, 0); }
     | expr '=' expr    { $$ = new_nterm ("=(%s,%s)", $1, $3, 0); }
     ;

decl : TYPENAME declarator ';'
			{ $$ = new_nterm ("<declare>(%s,%s)", $1, $2, 0); }
     | TYPENAME declarator '=' expr ';'
			{ $$ = new_nterm ("<init-declare>(%s,%s,%s)", $1,
					  $2, $4); }
     ;

declarator : ID
     | '(' declarator ')' { $$ = $2; }
     ;

%%

#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>

int
main (int argc, char **argv)
{
  if (argc != 2)
    abort ();
  if (!freopen (argv[1], "r", stdin))
    return 3;
  return yyparse ();
}

int
yylex (LEX_PARAMETERS)
{
  char buffer[256];
  int c;
  unsigned int i;
  static int lineNum = 1;
  static int colNum = 0;

#if YYPURE
# undef yylloc
# define yylloc (*llocp)
# undef yylval
# define yylval (*lvalp)
#endif

  while (1)
    {
      if (feof (stdin))
	abort ();
      c = getchar ();
      switch (c)
	{
	case EOF:
	  return 0;
	case '\t':
	  colNum = (colNum + 7) & ~7;
	  break;
	case ' ': case '\f':
	  colNum += 1;
	  break;
	case '\n':
	  lineNum += 1;
	  colNum = 0;
	  break;
	default:
	  {
	    int tok;
#if YYLSP_NEEDED
	    yylloc.first_line = yylloc.last_line = lineNum;
	    yylloc.first_column = colNum;
#endif
	    if (isalpha (c))
	      {
		i = 0;

		do
		  {
		    buffer[i++] = c;
		    colNum += 1;
		    if (i == sizeof buffer - 1)
		      abort ();
		    c = getchar ();
		  }
		while (isalnum (c) || c == '_');

		ungetc (c, stdin);
		buffer[i++] = 0;
		tok = isupper ((unsigned char) buffer[0]) ? TYPENAME : ID;
		yylval = new_term (strcpy ((char *) malloc (i), buffer));
	      }
	    else
	      {
		colNum += 1;
		tok = c;
		yylval = 0;
	      }
#if YYLSP_NEEDED
	    yylloc.last_column = colNum-1;
#endif
	    return tok;
	  }
	}
    }
}

void
yyerror (ERROR_PARAMETERS)
{
#if YYPURE && YYLSP_NEEDED
  /* Pacify GCC by using llocp.  */
  if (! llocp)
    abort ();
#endif
  fprintf (stderr, "%s\n", s);
}

static Node *
new_nterm (char const *form, Node *child0, Node *child1, Node *child2)
{
  Node *node = (Node *) malloc (sizeof (Node));
  node->nterm.isNterm = 1;
  node->nterm.parents = 0;
  node->nterm.form = form;
  node->nterm.children[0] = child0;
  if (child0)
    child0->nodeInfo.parents += 1;
  node->nterm.children[1] = child1;
  if (child1)
    child1->nodeInfo.parents += 1;
  node->nterm.children[2] = child2;
  if (child2)
    child2->nodeInfo.parents += 1;
  return node;
}

static Node *
new_term (char *text)
{
  Node *node = (Node *) malloc (sizeof (Node));
  node->term.isNterm = 0;
  node->term.parents = 0;
  node->term.text = text;
  return node;
}

static void
free_node (Node *node)
{
  if (!node)
    return;
  node->nodeInfo.parents -= 1;
  /* Free only if 0 (last parent) or -1 (no parents).  */
  if (node->nodeInfo.parents > 0)
    return;
  if (node->nodeInfo.isNterm == 1)
    {
      free_node (node->nterm.children[0]);
      free_node (node->nterm.children[1]);
      free_node (node->nterm.children[2]);
    }
  else
    free (node->term.text);
  free (node);
}

static char *
node_to_string (Node *node)
{
  char *child0;
  char *child1;
  char *child2;
  char *buffer;
  if (!node)
    {
      buffer = (char *) malloc (1);
      buffer[0] = 0;
    }
  else if (node->nodeInfo.isNterm == 1)
    {
      child0 = node_to_string (node->nterm.children[0]);
      child1 = node_to_string (node->nterm.children[1]);
      child2 = node_to_string (node->nterm.children[2]);
      buffer = (char *) malloc (strlen (node->nterm.form) + strlen (child0)
				+ strlen (child1) + strlen (child2) + 1);
      sprintf (buffer, node->nterm.form, child0, child1, child2);
      free (child0);
      free (child1);
      free (child2);
    }
  else
    buffer = strdup (node->term.text);
  return buffer;
}


static YYSTYPE
stmtMerge (YYSTYPE x0, YYSTYPE x1)
{
  return new_nterm ("<OR>(%s,%s)", x0, x1, 0);
}

_ATEOF



cat >test-input <<'_ATEOF'


z + q;

T x;

T x = y;

x = y;

T (x) + y;

T (x);

T (y) = z + q;

T (y y) = z + q;

z + q;

@

This is total garbage, but it should be ignored.
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/cxx-type.at:440: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o types.c types.y"
at_fn_check_prepare_notrace 'an embedded newline' "cxx-type.at:440"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o types.c types.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:440"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/cxx-type.at:440: bison --xml=xml-tests/test.xml -o types.c types.y"
at_fn_check_prepare_trace "cxx-type.at:440"
( $at_check_trace; bison --xml=xml-tests/test.xml -o types.c types.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:440"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/cxx-type.at:440: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:440"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:440"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/cxx-type.at:440: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:440"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:440"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/cxx-type.at:440: bison -o types.c types.y"
at_fn_check_prepare_trace "cxx-type.at:440"
( $at_check_trace; bison -o types.c types.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:440"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/cxx-type.at:440: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o types types.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS" "cxx-type.at:440"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:440"
$at_failed && at_fn_log_failure
$at_traceon; }

























{ set +x
$as_echo "$at_srcdir/cxx-type.at:442:  \$PREPARSER ./types test-input"
at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:442"
( $at_check_trace;  $PREPARSER ./types test-input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "syntax error
" | \
  $at_diff - "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "+(z,q)
<declare>(T,x)
<init-declare>(T,x,y)
=(x,y)
+(<cast>(x,T),y)
<OR>(<declare>(T,x),<cast>(x,T))
<OR>(<init-declare>(T,y,+(z,q)),=(<cast>(y,T),+(z,q)))
<error>
+(z,q)
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:442"
$at_failed && at_fn_log_failure
$at_traceon; }

  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_218
#AT_START_219
# 219. cxx-type.at:446: GLR: Merge conflicting parses, impure, locations
at_setup_line='cxx-type.at:446'
at_fn_banner 20
at_desc="GLR: Merge conflicting parses, impure, locations"
at_desc_line="219: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "219. cxx-type.at:446: testing ..."
  $at_traceon







# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.












cat >types.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Simplified C++ Type and Expression Grammar.  */

%locations

%{
  #include <stdio.h>
  union Node {
    struct {
      int isNterm;
      int parents;
    } nodeInfo;
    struct {
      int isNterm; /* 1 */
      int parents;
      char const *form;
      union Node *children[3];
    } nterm;
    struct {
      int isNterm; /* 0 */
      int parents;
      char *text;
    } term;
  };
  typedef union Node Node;
  static Node *new_nterm (char const *, Node *, Node *, Node *);
  static Node *new_term (char *);
  static void free_node (Node *);
  static char *node_to_string (Node *);
  #define YYSTYPE Node *
 static YYSTYPE stmtMerge (YYSTYPE x0, YYSTYPE x1);
  #define YYINITDEPTH 10
  #define YYSTACKEXPANDABLE 1
  struct YYLTYPE;
#if YYPURE
# if YYLSP_NEEDED
#  define LEX_PARAMETERS YYSTYPE *lvalp, struct YYLTYPE *llocp
#  define ERROR_PARAMETERS struct YYLTYPE *llocp, char const *s
# else
#  define LEX_PARAMETERS YYSTYPE *lvalp
# endif
#endif
#ifndef LEX_PARAMETERS
# define LEX_PARAMETERS void
#endif
#ifndef ERROR_PARAMETERS
# define ERROR_PARAMETERS char const *s
#endif
  int yylex (LEX_PARAMETERS);
  void yyerror (ERROR_PARAMETERS);
%}

%token TYPENAME ID

%right '='
%left '+'

%glr-parser

%destructor { free_node ($$); } stmt expr decl declarator TYPENAME ID

%%

prog :
     | prog stmt   {
			char *output;
			printf ("%d.%d-%d.%d: ",
			     @2.first_line, @2.first_column,
			     @2.last_line, @2.last_column);
			output = node_to_string ($2);
			printf ("%s\n", output);
			free (output);
			free_node ($2);
		   }
     ;

stmt : expr ';'  %merge <stmtMerge>	{ $$ = $1; }
     | decl      %merge <stmtMerge>
     | error ';'	{ $$ = new_nterm ("<error>", 0, 0, 0); }
     | '@'		{ YYACCEPT; }
     ;

expr : ID
     | TYPENAME '(' expr ')'
			{ $$ = new_nterm ("<cast>(%s,%s)", $3, $1, 0); }
     | expr '+' expr	{ $$ = new_nterm ("+(%s,%s)", $1, $3, 0); }
     | expr '=' expr    { $$ = new_nterm ("=(%s,%s)", $1, $3, 0); }
     ;

decl : TYPENAME declarator ';'
			{ $$ = new_nterm ("<declare>(%s,%s)", $1, $2, 0); }
     | TYPENAME declarator '=' expr ';'
			{ $$ = new_nterm ("<init-declare>(%s,%s,%s)", $1,
					  $2, $4); }
     ;

declarator : ID
     | '(' declarator ')' { $$ = $2; }
     ;

%%

#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>

int
main (int argc, char **argv)
{
  if (argc != 2)
    abort ();
  if (!freopen (argv[1], "r", stdin))
    return 3;
  return yyparse ();
}

int
yylex (LEX_PARAMETERS)
{
  char buffer[256];
  int c;
  unsigned int i;
  static int lineNum = 1;
  static int colNum = 0;

#if YYPURE
# undef yylloc
# define yylloc (*llocp)
# undef yylval
# define yylval (*lvalp)
#endif

  while (1)
    {
      if (feof (stdin))
	abort ();
      c = getchar ();
      switch (c)
	{
	case EOF:
	  return 0;
	case '\t':
	  colNum = (colNum + 7) & ~7;
	  break;
	case ' ': case '\f':
	  colNum += 1;
	  break;
	case '\n':
	  lineNum += 1;
	  colNum = 0;
	  break;
	default:
	  {
	    int tok;
#if YYLSP_NEEDED
	    yylloc.first_line = yylloc.last_line = lineNum;
	    yylloc.first_column = colNum;
#endif
	    if (isalpha (c))
	      {
		i = 0;

		do
		  {
		    buffer[i++] = c;
		    colNum += 1;
		    if (i == sizeof buffer - 1)
		      abort ();
		    c = getchar ();
		  }
		while (isalnum (c) || c == '_');

		ungetc (c, stdin);
		buffer[i++] = 0;
		tok = isupper ((unsigned char) buffer[0]) ? TYPENAME : ID;
		yylval = new_term (strcpy ((char *) malloc (i), buffer));
	      }
	    else
	      {
		colNum += 1;
		tok = c;
		yylval = 0;
	      }
#if YYLSP_NEEDED
	    yylloc.last_column = colNum-1;
#endif
	    return tok;
	  }
	}
    }
}

void
yyerror (ERROR_PARAMETERS)
{
#if YYPURE && YYLSP_NEEDED
  /* Pacify GCC by using llocp.  */
  if (! llocp)
    abort ();
#endif
  fprintf (stderr, "%s\n", s);
}

static Node *
new_nterm (char const *form, Node *child0, Node *child1, Node *child2)
{
  Node *node = (Node *) malloc (sizeof (Node));
  node->nterm.isNterm = 1;
  node->nterm.parents = 0;
  node->nterm.form = form;
  node->nterm.children[0] = child0;
  if (child0)
    child0->nodeInfo.parents += 1;
  node->nterm.children[1] = child1;
  if (child1)
    child1->nodeInfo.parents += 1;
  node->nterm.children[2] = child2;
  if (child2)
    child2->nodeInfo.parents += 1;
  return node;
}

static Node *
new_term (char *text)
{
  Node *node = (Node *) malloc (sizeof (Node));
  node->term.isNterm = 0;
  node->term.parents = 0;
  node->term.text = text;
  return node;
}

static void
free_node (Node *node)
{
  if (!node)
    return;
  node->nodeInfo.parents -= 1;
  /* Free only if 0 (last parent) or -1 (no parents).  */
  if (node->nodeInfo.parents > 0)
    return;
  if (node->nodeInfo.isNterm == 1)
    {
      free_node (node->nterm.children[0]);
      free_node (node->nterm.children[1]);
      free_node (node->nterm.children[2]);
    }
  else
    free (node->term.text);
  free (node);
}

static char *
node_to_string (Node *node)
{
  char *child0;
  char *child1;
  char *child2;
  char *buffer;
  if (!node)
    {
      buffer = (char *) malloc (1);
      buffer[0] = 0;
    }
  else if (node->nodeInfo.isNterm == 1)
    {
      child0 = node_to_string (node->nterm.children[0]);
      child1 = node_to_string (node->nterm.children[1]);
      child2 = node_to_string (node->nterm.children[2]);
      buffer = (char *) malloc (strlen (node->nterm.form) + strlen (child0)
				+ strlen (child1) + strlen (child2) + 1);
      sprintf (buffer, node->nterm.form, child0, child1, child2);
      free (child0);
      free (child1);
      free (child2);
    }
  else
    buffer = strdup (node->term.text);
  return buffer;
}


static YYSTYPE
stmtMerge (YYSTYPE x0, YYSTYPE x1)
{
  return new_nterm ("<OR>(%s,%s)", x0, x1, 0);
}

_ATEOF



cat >test-input <<'_ATEOF'


z + q;

T x;

T x = y;

x = y;

T (x) + y;

T (x);

T (y) = z + q;

T (y y) = z + q;

z + q;

@

This is total garbage, but it should be ignored.
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/cxx-type.at:447: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o types.c types.y"
at_fn_check_prepare_notrace 'an embedded newline' "cxx-type.at:447"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o types.c types.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:447"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/cxx-type.at:447: bison --xml=xml-tests/test.xml -o types.c types.y"
at_fn_check_prepare_trace "cxx-type.at:447"
( $at_check_trace; bison --xml=xml-tests/test.xml -o types.c types.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:447"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/cxx-type.at:447: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:447"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:447"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/cxx-type.at:447: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:447"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:447"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/cxx-type.at:447: bison -o types.c types.y"
at_fn_check_prepare_trace "cxx-type.at:447"
( $at_check_trace; bison -o types.c types.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:447"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/cxx-type.at:447: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o types types.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS" "cxx-type.at:447"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:447"
$at_failed && at_fn_log_failure
$at_traceon; }

























{ set +x
$as_echo "$at_srcdir/cxx-type.at:449:  \$PREPARSER ./types test-input"
at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:449"
( $at_check_trace;  $PREPARSER ./types test-input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "syntax error
" | \
  $at_diff - "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "3.0-3.5: +(z,q)
5.0-5.3: <declare>(T,x)
7.0-7.7: <init-declare>(T,x,y)
9.0-9.5: =(x,y)
11.0-11.9: +(<cast>(x,T),y)
13.0-13.5: <OR>(<declare>(T,x),<cast>(x,T))
15.0-15.13: <OR>(<init-declare>(T,y,+(z,q)),=(<cast>(y,T),+(z,q)))
17.0-17.15: <error>
19.0-19.5: +(z,q)
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:449"
$at_failed && at_fn_log_failure
$at_traceon; }

  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_219
#AT_START_220
# 220. cxx-type.at:453: GLR: Merge conflicting parses, pure, no locations
at_setup_line='cxx-type.at:453'
at_fn_banner 20
at_desc="GLR: Merge conflicting parses, pure, no locations"
at_desc_line="220: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "220. cxx-type.at:453: testing ..."
  $at_traceon







# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.












cat >types.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Simplified C++ Type and Expression Grammar.  */

%define api.pure

%{
  #include <stdio.h>
  union Node {
    struct {
      int isNterm;
      int parents;
    } nodeInfo;
    struct {
      int isNterm; /* 1 */
      int parents;
      char const *form;
      union Node *children[3];
    } nterm;
    struct {
      int isNterm; /* 0 */
      int parents;
      char *text;
    } term;
  };
  typedef union Node Node;
  static Node *new_nterm (char const *, Node *, Node *, Node *);
  static Node *new_term (char *);
  static void free_node (Node *);
  static char *node_to_string (Node *);
  #define YYSTYPE Node *
 static YYSTYPE stmtMerge (YYSTYPE x0, YYSTYPE x1);
  #define YYINITDEPTH 10
  #define YYSTACKEXPANDABLE 1
  struct YYLTYPE;
#if YYPURE
# if YYLSP_NEEDED
#  define LEX_PARAMETERS YYSTYPE *lvalp, struct YYLTYPE *llocp
#  define ERROR_PARAMETERS struct YYLTYPE *llocp, char const *s
# else
#  define LEX_PARAMETERS YYSTYPE *lvalp
# endif
#endif
#ifndef LEX_PARAMETERS
# define LEX_PARAMETERS void
#endif
#ifndef ERROR_PARAMETERS
# define ERROR_PARAMETERS char const *s
#endif
  int yylex (LEX_PARAMETERS);
  void yyerror (ERROR_PARAMETERS);
%}

%token TYPENAME ID

%right '='
%left '+'

%glr-parser

%destructor { free_node ($$); } stmt expr decl declarator TYPENAME ID

%%

prog :
     | prog stmt   {
			char *output;
			output = node_to_string ($2);
			printf ("%s\n", output);
			free (output);
			free_node ($2);
		   }
     ;

stmt : expr ';'  %merge <stmtMerge>	{ $$ = $1; }
     | decl      %merge <stmtMerge>
     | error ';'	{ $$ = new_nterm ("<error>", 0, 0, 0); }
     | '@'		{ YYACCEPT; }
     ;

expr : ID
     | TYPENAME '(' expr ')'
			{ $$ = new_nterm ("<cast>(%s,%s)", $3, $1, 0); }
     | expr '+' expr	{ $$ = new_nterm ("+(%s,%s)", $1, $3, 0); }
     | expr '=' expr    { $$ = new_nterm ("=(%s,%s)", $1, $3, 0); }
     ;

decl : TYPENAME declarator ';'
			{ $$ = new_nterm ("<declare>(%s,%s)", $1, $2, 0); }
     | TYPENAME declarator '=' expr ';'
			{ $$ = new_nterm ("<init-declare>(%s,%s,%s)", $1,
					  $2, $4); }
     ;

declarator : ID
     | '(' declarator ')' { $$ = $2; }
     ;

%%

#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>

int
main (int argc, char **argv)
{
  if (argc != 2)
    abort ();
  if (!freopen (argv[1], "r", stdin))
    return 3;
  return yyparse ();
}

int
yylex (LEX_PARAMETERS)
{
  char buffer[256];
  int c;
  unsigned int i;
  static int lineNum = 1;
  static int colNum = 0;

#if YYPURE
# undef yylloc
# define yylloc (*llocp)
# undef yylval
# define yylval (*lvalp)
#endif

  while (1)
    {
      if (feof (stdin))
	abort ();
      c = getchar ();
      switch (c)
	{
	case EOF:
	  return 0;
	case '\t':
	  colNum = (colNum + 7) & ~7;
	  break;
	case ' ': case '\f':
	  colNum += 1;
	  break;
	case '\n':
	  lineNum += 1;
	  colNum = 0;
	  break;
	default:
	  {
	    int tok;
#if YYLSP_NEEDED
	    yylloc.first_line = yylloc.last_line = lineNum;
	    yylloc.first_column = colNum;
#endif
	    if (isalpha (c))
	      {
		i = 0;

		do
		  {
		    buffer[i++] = c;
		    colNum += 1;
		    if (i == sizeof buffer - 1)
		      abort ();
		    c = getchar ();
		  }
		while (isalnum (c) || c == '_');

		ungetc (c, stdin);
		buffer[i++] = 0;
		tok = isupper ((unsigned char) buffer[0]) ? TYPENAME : ID;
		yylval = new_term (strcpy ((char *) malloc (i), buffer));
	      }
	    else
	      {
		colNum += 1;
		tok = c;
		yylval = 0;
	      }
#if YYLSP_NEEDED
	    yylloc.last_column = colNum-1;
#endif
	    return tok;
	  }
	}
    }
}

void
yyerror (ERROR_PARAMETERS)
{
#if YYPURE && YYLSP_NEEDED
  /* Pacify GCC by using llocp.  */
  if (! llocp)
    abort ();
#endif
  fprintf (stderr, "%s\n", s);
}

static Node *
new_nterm (char const *form, Node *child0, Node *child1, Node *child2)
{
  Node *node = (Node *) malloc (sizeof (Node));
  node->nterm.isNterm = 1;
  node->nterm.parents = 0;
  node->nterm.form = form;
  node->nterm.children[0] = child0;
  if (child0)
    child0->nodeInfo.parents += 1;
  node->nterm.children[1] = child1;
  if (child1)
    child1->nodeInfo.parents += 1;
  node->nterm.children[2] = child2;
  if (child2)
    child2->nodeInfo.parents += 1;
  return node;
}

static Node *
new_term (char *text)
{
  Node *node = (Node *) malloc (sizeof (Node));
  node->term.isNterm = 0;
  node->term.parents = 0;
  node->term.text = text;
  return node;
}

static void
free_node (Node *node)
{
  if (!node)
    return;
  node->nodeInfo.parents -= 1;
  /* Free only if 0 (last parent) or -1 (no parents).  */
  if (node->nodeInfo.parents > 0)
    return;
  if (node->nodeInfo.isNterm == 1)
    {
      free_node (node->nterm.children[0]);
      free_node (node->nterm.children[1]);
      free_node (node->nterm.children[2]);
    }
  else
    free (node->term.text);
  free (node);
}

static char *
node_to_string (Node *node)
{
  char *child0;
  char *child1;
  char *child2;
  char *buffer;
  if (!node)
    {
      buffer = (char *) malloc (1);
      buffer[0] = 0;
    }
  else if (node->nodeInfo.isNterm == 1)
    {
      child0 = node_to_string (node->nterm.children[0]);
      child1 = node_to_string (node->nterm.children[1]);
      child2 = node_to_string (node->nterm.children[2]);
      buffer = (char *) malloc (strlen (node->nterm.form) + strlen (child0)
				+ strlen (child1) + strlen (child2) + 1);
      sprintf (buffer, node->nterm.form, child0, child1, child2);
      free (child0);
      free (child1);
      free (child2);
    }
  else
    buffer = strdup (node->term.text);
  return buffer;
}


static YYSTYPE
stmtMerge (YYSTYPE x0, YYSTYPE x1)
{
  return new_nterm ("<OR>(%s,%s)", x0, x1, 0);
}

_ATEOF



cat >test-input <<'_ATEOF'


z + q;

T x;

T x = y;

x = y;

T (x) + y;

T (x);

T (y) = z + q;

T (y y) = z + q;

z + q;

@

This is total garbage, but it should be ignored.
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/cxx-type.at:454: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o types.c types.y"
at_fn_check_prepare_notrace 'an embedded newline' "cxx-type.at:454"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o types.c types.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:454"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/cxx-type.at:454: bison --xml=xml-tests/test.xml -o types.c types.y"
at_fn_check_prepare_trace "cxx-type.at:454"
( $at_check_trace; bison --xml=xml-tests/test.xml -o types.c types.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:454"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/cxx-type.at:454: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:454"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:454"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/cxx-type.at:454: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:454"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:454"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/cxx-type.at:454: bison -o types.c types.y"
at_fn_check_prepare_trace "cxx-type.at:454"
( $at_check_trace; bison -o types.c types.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:454"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/cxx-type.at:454: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o types types.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS" "cxx-type.at:454"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:454"
$at_failed && at_fn_log_failure
$at_traceon; }

























{ set +x
$as_echo "$at_srcdir/cxx-type.at:456:  \$PREPARSER ./types test-input"
at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:456"
( $at_check_trace;  $PREPARSER ./types test-input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "syntax error
" | \
  $at_diff - "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "+(z,q)
<declare>(T,x)
<init-declare>(T,x,y)
=(x,y)
+(<cast>(x,T),y)
<OR>(<declare>(T,x),<cast>(x,T))
<OR>(<init-declare>(T,y,+(z,q)),=(<cast>(y,T),+(z,q)))
<error>
+(z,q)
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:456"
$at_failed && at_fn_log_failure
$at_traceon; }

  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_220
#AT_START_221
# 221. cxx-type.at:459: GLR: Merge conflicting parses, pure, locations
at_setup_line='cxx-type.at:459'
at_fn_banner 20
at_desc="GLR: Merge conflicting parses, pure, locations"
at_desc_line="221: $at_desc "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "221. cxx-type.at:459: testing ..."
  $at_traceon







# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.












cat >types.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Simplified C++ Type and Expression Grammar.  */

%define api.pure %locations

%{
  #include <stdio.h>
  union Node {
    struct {
      int isNterm;
      int parents;
    } nodeInfo;
    struct {
      int isNterm; /* 1 */
      int parents;
      char const *form;
      union Node *children[3];
    } nterm;
    struct {
      int isNterm; /* 0 */
      int parents;
      char *text;
    } term;
  };
  typedef union Node Node;
  static Node *new_nterm (char const *, Node *, Node *, Node *);
  static Node *new_term (char *);
  static void free_node (Node *);
  static char *node_to_string (Node *);
  #define YYSTYPE Node *
 static YYSTYPE stmtMerge (YYSTYPE x0, YYSTYPE x1);
  #define YYINITDEPTH 10
  #define YYSTACKEXPANDABLE 1
  struct YYLTYPE;
#if YYPURE
# if YYLSP_NEEDED
#  define LEX_PARAMETERS YYSTYPE *lvalp, struct YYLTYPE *llocp
#  define ERROR_PARAMETERS struct YYLTYPE *llocp, char const *s
# else
#  define LEX_PARAMETERS YYSTYPE *lvalp
# endif
#endif
#ifndef LEX_PARAMETERS
# define LEX_PARAMETERS void
#endif
#ifndef ERROR_PARAMETERS
# define ERROR_PARAMETERS char const *s
#endif
  int yylex (LEX_PARAMETERS);
  void yyerror (ERROR_PARAMETERS);
%}

%token TYPENAME ID

%right '='
%left '+'

%glr-parser

%destructor { free_node ($$); } stmt expr decl declarator TYPENAME ID

%%

prog :
     | prog stmt   {
			char *output;
			printf ("%d.%d-%d.%d: ",
			     @2.first_line, @2.first_column,
			     @2.last_line, @2.last_column);
			output = node_to_string ($2);
			printf ("%s\n", output);
			free (output);
			free_node ($2);
		   }
     ;

stmt : expr ';'  %merge <stmtMerge>	{ $$ = $1; }
     | decl      %merge <stmtMerge>
     | error ';'	{ $$ = new_nterm ("<error>", 0, 0, 0); }
     | '@'		{ YYACCEPT; }
     ;

expr : ID
     | TYPENAME '(' expr ')'
			{ $$ = new_nterm ("<cast>(%s,%s)", $3, $1, 0); }
     | expr '+' expr	{ $$ = new_nterm ("+(%s,%s)", $1, $3, 0); }
     | expr '=' expr    { $$ = new_nterm ("=(%s,%s)", $1, $3, 0); }
     ;

decl : TYPENAME declarator ';'
			{ $$ = new_nterm ("<declare>(%s,%s)", $1, $2, 0); }
     | TYPENAME declarator '=' expr ';'
			{ $$ = new_nterm ("<init-declare>(%s,%s,%s)", $1,
					  $2, $4); }
     ;

declarator : ID
     | '(' declarator ')' { $$ = $2; }
     ;

%%

#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>

int
main (int argc, char **argv)
{
  if (argc != 2)
    abort ();
  if (!freopen (argv[1], "r", stdin))
    return 3;
  return yyparse ();
}

int
yylex (LEX_PARAMETERS)
{
  char buffer[256];
  int c;
  unsigned int i;
  static int lineNum = 1;
  static int colNum = 0;

#if YYPURE
# undef yylloc
# define yylloc (*llocp)
# undef yylval
# define yylval (*lvalp)
#endif

  while (1)
    {
      if (feof (stdin))
	abort ();
      c = getchar ();
      switch (c)
	{
	case EOF:
	  return 0;
	case '\t':
	  colNum = (colNum + 7) & ~7;
	  break;
	case ' ': case '\f':
	  colNum += 1;
	  break;
	case '\n':
	  lineNum += 1;
	  colNum = 0;
	  break;
	default:
	  {
	    int tok;
#if YYLSP_NEEDED
	    yylloc.first_line = yylloc.last_line = lineNum;
	    yylloc.first_column = colNum;
#endif
	    if (isalpha (c))
	      {
		i = 0;

		do
		  {
		    buffer[i++] = c;
		    colNum += 1;
		    if (i == sizeof buffer - 1)
		      abort ();
		    c = getchar ();
		  }
		while (isalnum (c) || c == '_');

		ungetc (c, stdin);
		buffer[i++] = 0;
		tok = isupper ((unsigned char) buffer[0]) ? TYPENAME : ID;
		yylval = new_term (strcpy ((char *) malloc (i), buffer));
	      }
	    else
	      {
		colNum += 1;
		tok = c;
		yylval = 0;
	      }
#if YYLSP_NEEDED
	    yylloc.last_column = colNum-1;
#endif
	    return tok;
	  }
	}
    }
}

void
yyerror (ERROR_PARAMETERS)
{
#if YYPURE && YYLSP_NEEDED
  /* Pacify GCC by using llocp.  */
  if (! llocp)
    abort ();
#endif
  fprintf (stderr, "%s\n", s);
}

static Node *
new_nterm (char const *form, Node *child0, Node *child1, Node *child2)
{
  Node *node = (Node *) malloc (sizeof (Node));
  node->nterm.isNterm = 1;
  node->nterm.parents = 0;
  node->nterm.form = form;
  node->nterm.children[0] = child0;
  if (child0)
    child0->nodeInfo.parents += 1;
  node->nterm.children[1] = child1;
  if (child1)
    child1->nodeInfo.parents += 1;
  node->nterm.children[2] = child2;
  if (child2)
    child2->nodeInfo.parents += 1;
  return node;
}

static Node *
new_term (char *text)
{
  Node *node = (Node *) malloc (sizeof (Node));
  node->term.isNterm = 0;
  node->term.parents = 0;
  node->term.text = text;
  return node;
}

static void
free_node (Node *node)
{
  if (!node)
    return;
  node->nodeInfo.parents -= 1;
  /* Free only if 0 (last parent) or -1 (no parents).  */
  if (node->nodeInfo.parents > 0)
    return;
  if (node->nodeInfo.isNterm == 1)
    {
      free_node (node->nterm.children[0]);
      free_node (node->nterm.children[1]);
      free_node (node->nterm.children[2]);
    }
  else
    free (node->term.text);
  free (node);
}

static char *
node_to_string (Node *node)
{
  char *child0;
  char *child1;
  char *child2;
  char *buffer;
  if (!node)
    {
      buffer = (char *) malloc (1);
      buffer[0] = 0;
    }
  else if (node->nodeInfo.isNterm == 1)
    {
      child0 = node_to_string (node->nterm.children[0]);
      child1 = node_to_string (node->nterm.children[1]);
      child2 = node_to_string (node->nterm.children[2]);
      buffer = (char *) malloc (strlen (node->nterm.form) + strlen (child0)
				+ strlen (child1) + strlen (child2) + 1);
      sprintf (buffer, node->nterm.form, child0, child1, child2);
      free (child0);
      free (child1);
      free (child2);
    }
  else
    buffer = strdup (node->term.text);
  return buffer;
}


static YYSTYPE
stmtMerge (YYSTYPE x0, YYSTYPE x1)
{
  return new_nterm ("<OR>(%s,%s)", x0, x1, 0);
}

_ATEOF



cat >test-input <<'_ATEOF'


z + q;

T x;

T x = y;

x = y;

T (x) + y;

T (x);

T (y) = z + q;

T (y y) = z + q;

z + q;

@

This is total garbage, but it should be ignored.
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/cxx-type.at:460: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o types.c types.y"
at_fn_check_prepare_notrace 'an embedded newline' "cxx-type.at:460"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o types.c types.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:460"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/cxx-type.at:460: bison --xml=xml-tests/test.xml -o types.c types.y"
at_fn_check_prepare_trace "cxx-type.at:460"
( $at_check_trace; bison --xml=xml-tests/test.xml -o types.c types.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:460"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/cxx-type.at:460: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:460"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:460"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/cxx-type.at:460: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:460"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:460"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/cxx-type.at:460: bison -o types.c types.y"
at_fn_check_prepare_trace "cxx-type.at:460"
( $at_check_trace; bison -o types.c types.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:460"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/cxx-type.at:460: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o types types.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS" "cxx-type.at:460"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:460"
$at_failed && at_fn_log_failure
$at_traceon; }

























{ set +x
$as_echo "$at_srcdir/cxx-type.at:462:  \$PREPARSER ./types test-input"
at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:462"
( $at_check_trace;  $PREPARSER ./types test-input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "syntax error
" | \
  $at_diff - "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "3.0-3.5: +(z,q)
5.0-5.3: <declare>(T,x)
7.0-7.7: <init-declare>(T,x,y)
9.0-9.5: =(x,y)
11.0-11.9: +(<cast>(x,T),y)
13.0-13.5: <OR>(<declare>(T,x),<cast>(x,T))
15.0-15.13: <OR>(<init-declare>(T,y,+(z,q)),=(<cast>(y,T),+(z,q)))
17.0-17.15: <error>
19.0-19.5: +(z,q)
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:462"
$at_failed && at_fn_log_failure
$at_traceon; }

  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_221
#AT_START_222
# 222. cxx-type.at:466: GLR: Verbose messages, resolve ambiguity, impure, no locations
at_setup_line='cxx-type.at:466'
at_fn_banner 20
at_desc="GLR: Verbose messages, resolve ambiguity, impure, no locations"
at_desc_line="222: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "222. cxx-type.at:466: testing ..."
  $at_traceon







# Using yacc.c?








# yyerror receives the location if %location & %pure & (%glr or %parse-param).

# yyerror always sees the locations (when activated), except if
# (yacc & pure & !param).  FIXME: This is wrong.  See the manual.


# The interface is pure: either because %define api.pure, or because we
# are using the C++ parsers.












cat >types.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Simplified C++ Type and Expression Grammar.  */

%error-verbose

%{
  #include <stdio.h>
  union Node {
    struct {
      int isNterm;
      int parents;
    } nodeInfo;
    struct {
      int isNterm; /* 1 */
      int parents;
      char const *form;
      union Node *children[3];
    } nterm;
    struct {
      int isNterm; /* 0 */
      int parents;
      char *text;
    } term;
  };
  typedef union Node Node;
  static Node *new_nterm (char const *, Node *, Node *, Node *);
  static Node *new_term (char *);
  static void free_node (Node *);
  static char *node_to_string (Node *);
  #define YYSTYPE Node *
 static YYSTYPE stmtMerge (YYSTYPE x0, YYSTYPE x1);
  #define YYINITDEPTH 10
  #define YYSTACKEXPANDABLE 1
  struct YYLTYPE;
#if YYPURE
# if YYLSP_NEEDED
#  define LEX_PARAMETERS YYSTYPE *lvalp, struct YYLTYPE *llocp
#  define ERROR_PARAMETERS struct YYLTYPE *llocp, char const *s
# else
#  define LEX_PARAMETERS YYSTYPE *lvalp
# endif
#endif
#ifndef LEX_PARAMETERS
# define LEX_PARAMETERS void
#endif
#ifndef ERROR_PARAMETERS
# define ERROR_PARAMETERS char const *s
#endif
  int yylex (LEX_PARAMETERS);
  void yyerror (ERROR_PARAMETERS);
%}

%token TYPENAME ID

%right '='
%left '+'

%glr-parser

%destructor { free_node ($$); } stmt expr decl declarator TYPENAME ID

%%

prog :
     | prog stmt   {
			char *output;
			output = node_to_string ($2);
			printf ("%s\n", output);
			free (output);
			free_node ($2);
		   }
     ;

stmt : expr ';'  %merge <stmtMerge>	{ $$ = $1; }
     | decl      %merge <stmtMerge>
     | error ';'	{ $$ = new_nterm ("<error>", 0, 0, 0); }
     | '@'		{ YYACCEPT; }
     ;

expr : ID
     | TYPENAME '(' expr ')'
			{ $$ = new_nterm ("<cast>(%s,%s)", $3, $1, 0); }
     | expr '+' expr	{ $$ = new_nterm ("+(%s,%s)", $1, $3, 0); }
     | expr '=' expr    { $$ = new_nterm ("=(%s,%s)", $1, $3, 0); }
     ;

decl : TYPENAME declarator ';'
			{ $$ = new_nterm ("<declare>(%s,%s)", $1, $2, 0); }
     | TYPENAME declarator '=' expr ';'
			{ $$ = new_nterm ("<init-declare>(%s,%s,%s)", $1,
					  $2, $4); }
     ;

declarator : ID
     | '(' declarator ')' { $$ = $2; }
     ;

%%

#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>

int
main (int argc, char **argv)
{
  if (argc != 2)
    abort ();
  if (!freopen (argv[1], "r", stdin))
    return 3;
  return yyparse ();
}

int
yylex (LEX_PARAMETERS)
{
  char buffer[256];
  int c;
  unsigned int i;
  static int lineNum = 1;
  static int colNum = 0;

#if YYPURE
# undef yylloc
# define yylloc (*llocp)
# undef yylval
# define yylval (*lvalp)
#endif

  while (1)
    {
      if (feof (stdin))
	abort ();
      c = getchar ();
      switch (c)
	{
	case EOF:
	  return 0;
	case '\t':
	  colNum = (colNum + 7) & ~7;
	  break;
	case ' ': case '\f':
	  colNum += 1;
	  break;
	case '\n':
	  lineNum += 1;
	  colNum = 0;
	  break;
	default:
	  {
	    int tok;
#if YYLSP_NEEDED
	    yylloc.first_line = yylloc.last_line = lineNum;
	    yylloc.first_column = colNum;
#endif
	    if (isalpha (c))
	      {
		i = 0;

		do
		  {
		    buffer[i++] = c;
		    colNum += 1;
		    if (i == sizeof buffer - 1)
		      abort ();
		    c = getchar ();
		  }
		while (isalnum (c) || c == '_');

		ungetc (c, stdin);
		buffer[i++] = 0;
		tok = isupper ((unsigned char) buffer[0]) ? TYPENAME : ID;
		yylval = new_term (strcpy ((char *) malloc (i), buffer));
	      }
	    else
	      {
		colNum += 1;
		tok = c;
		yylval = 0;
	      }
#if YYLSP_NEEDED
	    yylloc.last_column = colNum-1;
#endif
	    return tok;
	  }
	}
    }
}

void
yyerror (ERROR_PARAMETERS)
{
#if YYPURE && YYLSP_NEEDED
  /* Pacify GCC by using llocp.  */
  if (! llocp)
    abort ();
#endif
  fprintf (stderr, "%s\n", s);
}

static Node *
new_nterm (char const *form, Node *child0, Node *child1, Node *child2)
{
  Node *node = (Node *) malloc (sizeof (Node));
  node->nterm.isNterm = 1;
  node->nterm.parents = 0;
  node->nterm.form = form;
  node->nterm.children[0] = child0;
  if (child0)
    child0->nodeInfo.parents += 1;
  node->nterm.children[1] = child1;
  if (child1)
    child1->nodeInfo.parents += 1;
  node->nterm.children[2] = child2;
  if (child2)
    child2->nodeInfo.parents += 1;
  return node;
}

static Node *
new_term (char *text)
{
  Node *node = (Node *) malloc (sizeof (Node));
  node->term.isNterm = 0;
  node->term.parents = 0;
  node->term.text = text;
  return node;
}

static void
free_node (Node *node)
{
  if (!node)
    return;
  node->nodeInfo.parents -= 1;
  /* Free only if 0 (last parent) or -1 (no parents).  */
  if (node->nodeInfo.parents > 0)
    return;
  if (node->nodeInfo.isNterm == 1)
    {
      free_node (node->nterm.children[0]);
      free_node (node->nterm.children[1]);
      free_node (node->nterm.children[2]);
    }
  else
    free (node->term.text);
  free (node);
}

static char *
node_to_string (Node *node)
{
  char *child0;
  char *child1;
  char *child2;
  char *buffer;
  if (!node)
    {
      buffer = (char *) malloc (1);
      buffer[0] = 0;
    }
  else if (node->nodeInfo.isNterm == 1)
    {
      child0 = node_to_string (node->nterm.children[0]);
      child1 = node_to_string (node->nterm.children[1]);
      child2 = node_to_string (node->nterm.children[2]);
      buffer = (char *) malloc (strlen (node->nterm.form) + strlen (child0)
				+ strlen (child1) + strlen (child2) + 1);
      sprintf (buffer, node->nterm.form, child0, child1, child2);
      free (child0);
      free (child1);
      free (child2);
    }
  else
    buffer = strdup (node->term.text);
  return buffer;
}


static YYSTYPE
stmtMerge (YYSTYPE x0, YYSTYPE x1)
{
  return new_nterm ("<OR>(%s,%s)", x0, x1, 0);
}

_ATEOF



cat >test-input <<'_ATEOF'


z + q;

T x;

T x = y;

x = y;

T (x) + y;

T (x);

T (y) = z + q;

T (y y) = z + q;

z + q;

@

This is total garbage, but it should be ignored.
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/cxx-type.at:467: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o types.c types.y"
at_fn_check_prepare_notrace 'an embedded newline' "cxx-type.at:467"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o types.c types.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:467"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/cxx-type.at:467: bison --xml=xml-tests/test.xml -o types.c types.y"
at_fn_check_prepare_trace "cxx-type.at:467"
( $at_check_trace; bison --xml=xml-tests/test.xml -o types.c types.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:467"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/cxx-type.at:467: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:467"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:467"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/cxx-type.at:467: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "cxx-type.at:467"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:467"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/cxx-type.at:467: bison -o types.c types.y"
at_fn_check_prepare_trace "cxx-type.at:467"
( $at_check_trace; bison -o types.c types.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:467"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/cxx-type.at:467: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o types types.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS" "cxx-type.at:467"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o types types.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:467"
$at_failed && at_fn_log_failure
$at_traceon; }

























{ set +x
$as_echo "$at_srcdir/cxx-type.at:469:  \$PREPARSER ./types test-input"
at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:469"
( $at_check_trace;  $PREPARSER ./types test-input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "syntax error, unexpected ID, expecting '=' or '+' or ')'
" | \
  $at_diff - "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "+(z,q)
<declare>(T,x)
<init-declare>(T,x,y)
=(x,y)
+(<cast>(x,T),y)
<OR>(<declare>(T,x),<cast>(x,T))
<OR>(<init-declare>(T,y,+(z,q)),=(<cast>(y,T),+(z,q)))
<error>
+(z,q)
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:469"
$at_failed && at_fn_log_failure
$at_traceon; }

  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_222
#AT_START_223
# 223. glr-regression.at:24: Badly Collapsed GLR States
at_setup_line='glr-regression.at:24'
at_fn_banner 21
at_desc="Badly Collapsed GLR States"
at_desc_line="223: $at_desc                     "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "223. glr-regression.at:24: testing ..."
  $at_traceon


cat >glr-regr1.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Regression Test: Improper state compression */
/* Reported by Scott McPeak */

%{
#include <stdio.h>
#include <stdlib.h>

#define YYSTYPE int
static YYSTYPE exprMerge (YYSTYPE x0, YYSTYPE x1);
int yylex (void);
void yyerror (char const *msg);
%}


%glr-parser


/* -------- productions ------ */
%%

StartSymbol: E  { $$=0; }                   %merge <exprMerge>
           ;

E: E 'P' E { $$=1; printf("E -> E 'P' E\n"); }  %merge <exprMerge>
 | 'B'     { $$=2; printf("E -> 'B'\n"); }      %merge <exprMerge>
 ;



/* ---------- C code ----------- */
%%

static YYSTYPE exprMerge (YYSTYPE x0, YYSTYPE x1)
{
  (void) x0;
  (void) x1;
  printf ("<OR>\n");
  return 0;
}

int
main (void)
{
  return yyparse ();
}

void
yyerror (char const *msg)
{
  fprintf (stderr, "%s\n", msg);
}


int
yylex (void)
{
  for (;;)
    {
      int ch;
      if (feof (stdin))
	abort ();
      ch = getchar ();
      if (ch == EOF)
	return 0;
      else if (ch == 'B' || ch == 'P')
	return ch;
    }
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/glr-regression.at:97: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o glr-regr1.c glr-regr1.y"
at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:97"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o glr-regr1.c glr-regr1.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:97"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:97: bison --xml=xml-tests/test.xml -o glr-regr1.c glr-regr1.y"
at_fn_check_prepare_trace "glr-regression.at:97"
( $at_check_trace; bison --xml=xml-tests/test.xml -o glr-regr1.c glr-regr1.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:97"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:97: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:97"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:97"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:97: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:97"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:97"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:97: bison -o glr-regr1.c glr-regr1.y"
at_fn_check_prepare_trace "glr-regression.at:97"
( $at_check_trace; bison -o glr-regr1.c glr-regr1.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "glr-regr1.y: conflicts: 1 shift/reduce
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:97"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:100: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr1 glr-regr1.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr1 glr-regr1.c $LIBS" "glr-regression.at:100"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr1 glr-regr1.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:100"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:101:  \$PREPARSER echo BPBPB | ./glr-regr1"
at_fn_check_prepare_dynamic " $PREPARSER echo BPBPB | ./glr-regr1" "glr-regression.at:101"
( $at_check_trace;  $PREPARSER echo BPBPB | ./glr-regr1
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "E -> 'B'
E -> 'B'
E -> E 'P' E
E -> 'B'
E -> E 'P' E
E -> 'B'
E -> E 'P' E
E -> E 'P' E
<OR>
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:101"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_223
#AT_START_224
# 224. glr-regression.at:119: Improper handling of embedded actions and dollar(-N) in GLR parsers
at_setup_line='glr-regression.at:119'
at_fn_banner 21
at_desc="Improper handling of embedded actions and dollar(-N) in GLR parsers"
at_desc_line="224: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "224. glr-regression.at:119: testing ..."
  $at_traceon


cat >glr-regr2a.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Regression Test: Improper handling of embedded actions and $-N  */
/* Reported by S. Eken */

%{
  #define YYSTYPE char *

  #include <ctype.h>
  #include <stdio.h>
  #include <stdlib.h>
  #include <string.h>
  int yylex (void);
  void yyerror (char const *);
%}

%glr-parser

%%

command:
    's' var 't'
       { printf ("Variable: '%s'\n", $2); }
    'v' 'x' 'q'
       { free ($2); }
  | 's' var_list 't' 'e'
       { printf ("Varlist: '%s'\n", $2); free ($2); }
  | 's' var 't' var_printer 'x'
       { free ($2); }
  ;

var:
  'V'
     { $$ = $1; }
  ;

var_list:
  var
    { $$ = $1; }
  | var ',' var_list
    {
      char *s = (char *) realloc ($1, strlen ($1) + 1 + strlen ($3) + 1);
      strcat (s, ",");
      strcat (s, $3);
      free ($3);
      $$ = s;
    }
  ;

var_printer: 'v'
   { printf ("Variable: '%s'\n", $-1); }

%%

FILE *input;

int
yylex (void)
{
  char buf[50];
  char *s;
  if (feof (stdin))
    abort ();
  switch (fscanf (input, " %1[a-z,]", buf)) {
  case 1:
    return buf[0];
  case EOF:
    return 0;
  default:
    break;
  }
  if (fscanf (input, "%49s", buf) != 1)
    return 0;
  if (sizeof buf - 1 <= strlen (buf))
    abort ();
  s = (char *) malloc (strlen (buf) + 1);
  strcpy (s, buf);
  yylval = s;
  return 'V';
}

void
yyerror (char const *s)
{ printf ("%s\n", s);
}

int
main (int argc, char **argv)
{
  input = stdin;
  if (argc == 2 && !(input = fopen (argv[1], "r"))) return 3;
  return yyparse ();
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/glr-regression.at:215: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o glr-regr2a.c glr-regr2a.y"
at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:215"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o glr-regr2a.c glr-regr2a.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:215"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:215: bison --xml=xml-tests/test.xml -o glr-regr2a.c glr-regr2a.y"
at_fn_check_prepare_trace "glr-regression.at:215"
( $at_check_trace; bison --xml=xml-tests/test.xml -o glr-regr2a.c glr-regr2a.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:215"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:215: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:215"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:215"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:215: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:215"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:215"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:215: bison -o glr-regr2a.c glr-regr2a.y"
at_fn_check_prepare_trace "glr-regression.at:215"
( $at_check_trace; bison -o glr-regr2a.c glr-regr2a.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "glr-regr2a.y: conflicts: 2 shift/reduce
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:215"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:218: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr2a glr-regr2a.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr2a glr-regr2a.c $LIBS" "glr-regression.at:218"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr2a glr-regr2a.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:218"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/glr-regression.at:220:  \$PREPARSER echo s VARIABLE_1 t v x q | ./glr-regr2a"
at_fn_check_prepare_dynamic " $PREPARSER echo s VARIABLE_1 t v x q | ./glr-regr2a" "glr-regression.at:220"
( $at_check_trace;  $PREPARSER echo s VARIABLE_1 t v x q | ./glr-regr2a
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "Variable: 'VARIABLE_1'
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:220"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:223:  \$PREPARSER echo s VARIABLE_1 , ANOTHER_VARIABLE_2 t e | ./glr-regr2a"
at_fn_check_prepare_dynamic " $PREPARSER echo s VARIABLE_1 , ANOTHER_VARIABLE_2 t e | ./glr-regr2a" "glr-regression.at:223"
( $at_check_trace;  $PREPARSER echo s VARIABLE_1 , ANOTHER_VARIABLE_2 t e | ./glr-regr2a
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "Varlist: 'VARIABLE_1,ANOTHER_VARIABLE_2'
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:223"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:227:  \$PREPARSER echo s VARIABLE_3 t v x | ./glr-regr2a"
at_fn_check_prepare_dynamic " $PREPARSER echo s VARIABLE_3 t v x | ./glr-regr2a" "glr-regression.at:227"
( $at_check_trace;  $PREPARSER echo s VARIABLE_3 t v x | ./glr-regr2a
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "Variable: 'VARIABLE_3'
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:227"
$at_failed && at_fn_log_failure
$at_traceon; }



  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_224
#AT_START_225
# 225. glr-regression.at:238: Improper merging of GLR delayed action sets
at_setup_line='glr-regression.at:238'
at_fn_banner 21
at_desc="Improper merging of GLR delayed action sets"
at_desc_line="225: $at_desc    "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "225. glr-regression.at:238: testing ..."
  $at_traceon


cat >glr-regr3.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

/* Regression Test: Improper merging of GLR delayed action sets.  */
/* Reported by M. Rosien */

%{
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>

static int MergeRule (int x0, int x1);
static void yyerror (char const * s);
int yylex (void);

#define RULE(x) (1 << (x))

%}

%glr-parser

%token BAD_CHAR
%token P1 P2 T1 T2 T3 T4 O1 O2

%%

S : P1 T4 O2 NT6 P2  { printf ("Result: %x\n", $4); }
;

NT1 : P1 T1 O1 T2 P2 { $$ = RULE(2); }  %merge<MergeRule>
;

NT2 : NT1             { $$ = RULE(3); } %merge<MergeRule>
    | P1 NT1 O1 T3 P2 { $$ = RULE(4); } %merge<MergeRule>
;

NT3 : T3              { $$ = RULE(5); } %merge<MergeRule>
    | P1 NT1 O1 T3 P2 { $$ = RULE(6); } %merge<MergeRule>
;

NT4 : NT3              { $$ = RULE(7); } %merge<MergeRule>
    | NT2              { $$ = RULE(8); } %merge<MergeRule>
    | P1 NT2 O1 NT3 P2 { $$ = RULE(9); } %merge<MergeRule>
;

NT5 : NT4              { $$ = RULE(10); } %merge<MergeRule>
;

NT6 : P1 NT1 O1 T3 P2  { $$ = RULE(11) | $2; } %merge<MergeRule>
    | NT5              { $$ = RULE(12) | $1; } %merge<MergeRule>
;

%%

static int MergeRule (int x0, int x1) {
  return x0 | x1;
}

static void yyerror(char const * s) {
  fprintf(stderr,"error: %s\n",s);
}

FILE *input = NULL;

int P[] = { P1, P2 };
int O[] = { O1, O2 };
int T[] = { T1, T2, T3, T4 };

int yylex (void)
{
  char inp[3];
  if (feof (stdin))
    abort ();
  if (fscanf (input, "%2s", inp) == EOF)
    return 0;
  switch (inp[0])
    {
    case 'p': return P[inp[1] - '1'];
    case 't': return T[inp[1] - '1'];
    case 'o': return O[inp[1] - '1'];
    }
  return BAD_CHAR;
}

int main(int argc, char* argv[]) {
  input = stdin;
  if (argc == 2 && !(input = fopen (argv[1], "r"))) return 3;
  return yyparse ();
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/glr-regression.at:329: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o glr-regr3.c glr-regr3.y"
at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:329"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o glr-regr3.c glr-regr3.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:329"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:329: bison --xml=xml-tests/test.xml -o glr-regr3.c glr-regr3.y"
at_fn_check_prepare_trace "glr-regression.at:329"
( $at_check_trace; bison --xml=xml-tests/test.xml -o glr-regr3.c glr-regr3.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:329"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:329: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:329"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:329"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:329: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:329"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:329"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:329: bison -o glr-regr3.c glr-regr3.y"
at_fn_check_prepare_trace "glr-regression.at:329"
( $at_check_trace; bison -o glr-regr3.c glr-regr3.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "glr-regr3.y: conflicts: 1 shift/reduce, 1 reduce/reduce
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:329"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:332: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr3 glr-regr3.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr3 glr-regr3.c $LIBS" "glr-regression.at:332"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr3 glr-regr3.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:332"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/glr-regression.at:334:  \$PREPARSER echo p1 t4 o2 p1 p1 t1 o1 t2 p2 o1 t3 p2 p2 | ./glr-regr3"
at_fn_check_prepare_dynamic " $PREPARSER echo p1 t4 o2 p1 p1 t1 o1 t2 p2 o1 t3 p2 p2 | ./glr-regr3" "glr-regression.at:334"
( $at_check_trace;  $PREPARSER echo p1 t4 o2 p1 p1 t1 o1 t2 p2 o1 t3 p2 p2 | ./glr-regr3
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "Result: 1c04
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:334"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_225
#AT_START_226
# 226. glr-regression.at:347: Duplicate representation of merged trees
at_setup_line='glr-regression.at:347'
at_fn_banner 21
at_desc="Duplicate representation of merged trees"
at_desc_line="226: $at_desc       "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "226. glr-regression.at:347: testing ..."
  $at_traceon


cat >glr-regr4.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%union { char *ptr; }
%type <ptr> S A A1 A2 B
%glr-parser

%{
  #include <stdio.h>
  #include <stdlib.h>
  #include <string.h>
  static char *merge (YYSTYPE, YYSTYPE);
  static char *make_value (char const *, char const *);
  static void yyerror (char const *);
  static int yylex (void);
  static char *ptrs[100];
  static char **ptrs_next = ptrs;
%}

%%

tree: S { printf ("%s\n", $1); } ;

S:
  A   %merge<merge> { $$ = make_value ("S", $1); }
  | B %merge<merge> { $$ = make_value ("S", $1); }
  ;

A:
  A1   %merge<merge> { $$ = make_value ("A", $1); }
  | A2 %merge<merge> { $$ = make_value ("A", $1); }
  ;

A1: 'a' { $$ = make_value ("A1", "'a'"); } ;
A2: 'a' { $$ = make_value ("A2", "'a'"); } ;
B:  'a' { $$ = make_value ("B", "'a'");  } ;

%%

static int
yylex (void)
{
  static char const input[] = "a";
  static size_t toknum;
  if (! (toknum < sizeof input))
    abort ();
  return input[toknum++];
}

int
main (void)
{
  int status = yyparse ();
  while (ptrs_next != ptrs)
    free (*--ptrs_next);
  return status;
}

static char *
make_value (char const *parent, char const *child)
{
  char const format[] = "%s <- %s";
  char *value = *ptrs_next++ =
    (char *) malloc (strlen (parent) + strlen (child) + sizeof format);
  sprintf (value, format, parent, child);
  return value;
}

static char *
merge (YYSTYPE s1, YYSTYPE s2)
{
  char const format[] = "merge{ %s and %s }";
  char *value = *ptrs_next++ =
    (char *) malloc (strlen (s1.ptr) + strlen (s2.ptr) + sizeof format);
  sprintf (value, format, s1.ptr, s2.ptr);
  return value;
}

static void
yyerror (char const *msg)
{
  fprintf (stderr, "%s\n", msg);
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/glr-regression.at:433: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o glr-regr4.c glr-regr4.y"
at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:433"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o glr-regr4.c glr-regr4.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:433"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:433: bison --xml=xml-tests/test.xml -o glr-regr4.c glr-regr4.y"
at_fn_check_prepare_trace "glr-regression.at:433"
( $at_check_trace; bison --xml=xml-tests/test.xml -o glr-regr4.c glr-regr4.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:433"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:433: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:433"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:433"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:433: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:433"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:433"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:433: bison -o glr-regr4.c glr-regr4.y"
at_fn_check_prepare_trace "glr-regression.at:433"
( $at_check_trace; bison -o glr-regr4.c glr-regr4.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "glr-regr4.y: conflicts: 1 reduce/reduce
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:433"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:436: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr4 glr-regr4.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr4 glr-regr4.c $LIBS" "glr-regression.at:436"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr4 glr-regr4.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:436"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/glr-regression.at:438:  \$PREPARSER ./glr-regr4"
at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr4" "glr-regression.at:438"
( $at_check_trace;  $PREPARSER ./glr-regr4
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "merge{ S <- merge{ A <- A1 <- 'a' and A <- A2 <- 'a' } and S <- B <- 'a' }
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:438"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_226
#AT_START_227
# 227. glr-regression.at:450: User destructor for unresolved GLR semantic value
at_setup_line='glr-regression.at:450'
at_fn_banner 21
at_desc="User destructor for unresolved GLR semantic value"
at_desc_line="227: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "227. glr-regression.at:450: testing ..."
  $at_traceon


cat >glr-regr5.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%{
  #include <stdio.h>
  #include <stdlib.h>
  static void yyerror (char const *);
  static int yylex (void);
  enum { MAGIC_VALUE = -1057808125 }; /* originally chosen at random */
%}

%glr-parser
%union { int value; }
%type <value> start

%destructor {
  if ($$ != MAGIC_VALUE)
    {
      fprintf (stderr, "Bad destructor call.\n");
      exit (EXIT_FAILURE);
    }
} start

%%

start:
   'a' { $$ = MAGIC_VALUE; }
   | 'a' { $$ = MAGIC_VALUE; }
   ;

%%

static int
yylex (void)
{
  static char const input[] = "a";
  static size_t toknum;
  if (! (toknum < sizeof input))
    abort ();
  return input[toknum++];
}

static void
yyerror (char const *msg)
{
  fprintf (stderr, "%s\n", msg);
}

int
main (void)
{
  return yyparse () != 1;
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/glr-regression.at:506: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o glr-regr5.c glr-regr5.y"
at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:506"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o glr-regr5.c glr-regr5.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:506"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:506: bison --xml=xml-tests/test.xml -o glr-regr5.c glr-regr5.y"
at_fn_check_prepare_trace "glr-regression.at:506"
( $at_check_trace; bison --xml=xml-tests/test.xml -o glr-regr5.c glr-regr5.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:506"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:506: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:506"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:506"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:506: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:506"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:506"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:506: bison -o glr-regr5.c glr-regr5.y"
at_fn_check_prepare_trace "glr-regression.at:506"
( $at_check_trace; bison -o glr-regr5.c glr-regr5.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "glr-regr5.y: conflicts: 1 reduce/reduce
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:506"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:509: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr5 glr-regr5.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr5 glr-regr5.c $LIBS" "glr-regression.at:509"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr5 glr-regr5.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:509"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/glr-regression.at:511:  \$PREPARSER ./glr-regr5"
at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr5" "glr-regression.at:511"
( $at_check_trace;  $PREPARSER ./glr-regr5
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "syntax is ambiguous
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:511"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_227
#AT_START_228
# 228. glr-regression.at:523: User destructor after an error during a split parse
at_setup_line='glr-regression.at:523'
at_fn_banner 21
at_desc="User destructor after an error during a split parse"
at_desc_line="228: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "228. glr-regression.at:523: testing ..."
  $at_traceon


cat >glr-regr6.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%{
  #include <stdio.h>
  #include <stdlib.h>
  static void yyerror (char const *);
  static int yylex (void);
%}

%glr-parser
%union { int value; }
%type <value> 'a'

%destructor {
  printf ("Destructor called.\n");
} 'a'

%%

start: 'a' | 'a' ;

%%

static int
yylex (void)
{
  static char const input[] = "a";
  static size_t toknum;
  if (! (toknum < sizeof input))
    abort ();
  return input[toknum++];
}

static void
yyerror (char const *msg)
{
  fprintf (stderr, "%s\n", msg);
}

int
main (void)
{
  return yyparse () != 1;
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/glr-regression.at:571: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o glr-regr6.c glr-regr6.y"
at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:571"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o glr-regr6.c glr-regr6.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:571"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:571: bison --xml=xml-tests/test.xml -o glr-regr6.c glr-regr6.y"
at_fn_check_prepare_trace "glr-regression.at:571"
( $at_check_trace; bison --xml=xml-tests/test.xml -o glr-regr6.c glr-regr6.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:571"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:571: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:571"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:571"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:571: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:571"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:571"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:571: bison -o glr-regr6.c glr-regr6.y"
at_fn_check_prepare_trace "glr-regression.at:571"
( $at_check_trace; bison -o glr-regr6.c glr-regr6.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "glr-regr6.y: conflicts: 1 reduce/reduce
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:571"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:574: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr6 glr-regr6.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr6 glr-regr6.c $LIBS" "glr-regression.at:574"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr6 glr-regr6.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:574"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/glr-regression.at:576:  \$PREPARSER ./glr-regr6"
at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr6" "glr-regression.at:576"
( $at_check_trace;  $PREPARSER ./glr-regr6
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "syntax is ambiguous
" | \
  $at_diff - "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "Destructor called.
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:576"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_228
#AT_START_229
# 229. glr-regression.at:590: Duplicated user destructor for lookahead
at_setup_line='glr-regression.at:590'
at_fn_banner 21
at_desc="Duplicated user destructor for lookahead"
at_desc_line="229: $at_desc       "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "229. glr-regression.at:590: testing ..."
  $at_traceon


cat >glr-regr7.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%{
  #include <stdio.h>
  #include <stdlib.h>
  static void yyerror (char const *);
  static int yylex (void);
  #define YYSTACKEXPANDABLE 0
  typedef struct count_node {
    int count;
    struct count_node *prev;
  } count_node;
  static count_node *tail;
%}

%glr-parser
%union { count_node *node; }
%type <node> 'a'

%destructor {
  if ($$->count++)
    fprintf (stderr, "Destructor called on same value twice.\n");
} 'a'

%%

start:
    stack1 start
  | stack2 start
  | /* empty */
  ;
stack1: 'a' ;
stack2: 'a' ;

%%

static int
yylex (void)
{
  yylval.node = (count_node*) malloc (sizeof *yylval.node);
  if (!yylval.node)
    {
      fprintf (stderr, "Test inconclusive.\n");
      exit (EXIT_FAILURE);
    }
  yylval.node->count = 0;
  yylval.node->prev = tail;
  tail = yylval.node;
  return 'a';
}

static void
yyerror (char const *msg)
{
  fprintf (stderr, "%s\n", msg);
}

int
main (void)
{
  int status = yyparse ();
  while (tail)
    {
      count_node *prev = tail->prev;
      free (tail);
      tail = prev;
    }
  return status;
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/glr-regression.at:663: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o glr-regr7.c glr-regr7.y"
at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:663"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o glr-regr7.c glr-regr7.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:663"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:663: bison --xml=xml-tests/test.xml -o glr-regr7.c glr-regr7.y"
at_fn_check_prepare_trace "glr-regression.at:663"
( $at_check_trace; bison --xml=xml-tests/test.xml -o glr-regr7.c glr-regr7.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:663"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:663: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:663"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:663"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:663: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:663"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:663"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:663: bison -o glr-regr7.c glr-regr7.y"
at_fn_check_prepare_trace "glr-regression.at:663"
( $at_check_trace; bison -o glr-regr7.c glr-regr7.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "glr-regr7.y: conflicts: 2 reduce/reduce
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:663"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:666: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr7 glr-regr7.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr7 glr-regr7.c $LIBS" "glr-regression.at:666"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr7 glr-regr7.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:666"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/glr-regression.at:668:  \$PREPARSER ./glr-regr7"
at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr7" "glr-regression.at:668"
( $at_check_trace;  $PREPARSER ./glr-regr7
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "memory exhausted
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/glr-regression.at:668"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_229
#AT_START_230
# 230. glr-regression.at:682: Incorrectly initialized location for empty right-hand side in GLR
at_setup_line='glr-regression.at:682'
at_fn_banner 21
at_desc="Incorrectly initialized location for empty right-hand side in GLR"
at_desc_line="230: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "230. glr-regression.at:682: testing ..."
  $at_traceon


cat >glr-regr8.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%{
  #include <stdio.h>
  #include <stdlib.h>
  static void yyerror (char const *);
  static int yylex (void);
  static void yyerror (char const *msg);
%}

%token T_CONSTANT
%token T_PORT
%token T_SIGNAL

%glr-parser

%%


PortClause	: T_PORT InterfaceDeclaration T_PORT
		{ printf("%d/%d - %d/%d - %d/%d\n",
			 @1.first_column, @1.last_column,
			 @2.first_column, @2.last_column,
			 @3.first_column, @3.last_column); }
	;

InterfaceDeclaration	: OptConstantWord	%dprec 1
	| OptSignalWord	%dprec 2
	;

OptConstantWord	: /* empty */
	| T_CONSTANT
	;

OptSignalWord	: /* empty */
		{ printf("empty: %d/%d\n", @$.first_column, @$.last_column); }
	| T_SIGNAL
	;

%%

void
yyerror (char const *msg)
{
  fprintf (stderr, "%s\n", msg);
}

static int lexIndex;

int yylex (void)
{
  lexIndex += 1;
  switch (lexIndex)
    {
    default:
      abort ();
    case 1:
      yylloc.first_column = 1;
      yylloc.last_column = 9;
      return T_PORT;
    case 2:
      yylloc.first_column = 13;
      yylloc.last_column = 17;
      return T_PORT;
    case 3:
      return 0;
    }
}

int
main (void)
{
  yyparse();
  return 0;
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/glr-regression.at:761: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o glr-regr8.c glr-regr8.y"
at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:761"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o glr-regr8.c glr-regr8.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:761"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:761: bison --xml=xml-tests/test.xml -o glr-regr8.c glr-regr8.y"
at_fn_check_prepare_trace "glr-regression.at:761"
( $at_check_trace; bison --xml=xml-tests/test.xml -o glr-regr8.c glr-regr8.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:761"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:761: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:761"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:761"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:761: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:761"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:761"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:761: bison -o glr-regr8.c glr-regr8.y"
at_fn_check_prepare_trace "glr-regression.at:761"
( $at_check_trace; bison -o glr-regr8.c glr-regr8.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "glr-regr8.y: conflicts: 1 reduce/reduce
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:761"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:764: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr8 glr-regr8.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr8 glr-regr8.c $LIBS" "glr-regression.at:764"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr8 glr-regr8.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:764"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/glr-regression.at:766:  \$PREPARSER ./glr-regr8"
at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr8" "glr-regression.at:766"
( $at_check_trace;  $PREPARSER ./glr-regr8
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "empty: 9/9
1/9 - 9/9 - 13/17
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:766"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_230
#AT_START_231
# 231. glr-regression.at:780: No users destructors if stack 0 deleted
at_setup_line='glr-regression.at:780'
at_fn_banner 21
at_desc="No users destructors if stack 0 deleted"
at_desc_line="231: $at_desc        "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "231. glr-regression.at:780: testing ..."
  $at_traceon


cat >glr-regr9.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%{
# include <stdio.h>
# include <stdlib.h>
  static void yyerror (char const *);
  static int yylex (void);
# define YYSTACKEXPANDABLE 0
  static int tokens = 0;
  static int destructors = 0;
# define USE(Var)
%}

%glr-parser
%union { int dummy; }
%type <dummy> 'a'

%destructor {
  destructors += 1;
} 'a'

%%

start:
    ambig0 'a'   { destructors += 2; USE ($2); }
  | ambig1 start { destructors += 1; }
  | ambig2 start { destructors += 1; }
  ;

ambig0: 'a' ;
ambig1: 'a' ;
ambig2: 'a' ;

%%

static int
yylex (void)
{
  tokens += 1;
  return 'a';
}

static void
yyerror (char const *msg)
{
  fprintf (stderr, "%s\n", msg);
}

int
main (void)
{
  int exit_status;
  exit_status = yyparse ();
  if (tokens != destructors)
    {
      fprintf (stderr, "Tokens = %d, Destructors = %d\n", tokens, destructors);
      return 1;
    }
  return !exit_status;
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/glr-regression.at:844: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o glr-regr9.c glr-regr9.y"
at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:844"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o glr-regr9.c glr-regr9.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:844"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:844: bison --xml=xml-tests/test.xml -o glr-regr9.c glr-regr9.y"
at_fn_check_prepare_trace "glr-regression.at:844"
( $at_check_trace; bison --xml=xml-tests/test.xml -o glr-regr9.c glr-regr9.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:844"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:844: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:844"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:844"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:844: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:844"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:844"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:844: bison -o glr-regr9.c glr-regr9.y"
at_fn_check_prepare_trace "glr-regression.at:844"
( $at_check_trace; bison -o glr-regr9.c glr-regr9.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "glr-regr9.y: conflicts: 1 reduce/reduce
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:844"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:847: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr9 glr-regr9.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr9 glr-regr9.c $LIBS" "glr-regression.at:847"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr9 glr-regr9.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:847"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/glr-regression.at:849:  \$PREPARSER ./glr-regr9"
at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr9" "glr-regression.at:849"
( $at_check_trace;  $PREPARSER ./glr-regr9
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "memory exhausted
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:849"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_231
#AT_START_232
# 232. glr-regression.at:860: Corrupted semantic options if user action cuts parse
at_setup_line='glr-regression.at:860'
at_fn_banner 21
at_desc="Corrupted semantic options if user action cuts parse"
at_desc_line="232: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "232. glr-regression.at:860: testing ..."
  $at_traceon


cat >glr-regr10.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%{
# include <stdlib.h>
# include <stdio.h>
  static void yyerror (char const *);
  static int yylex (void);
  #define GARBAGE_SIZE 50
  static char garbage[GARBAGE_SIZE];
%}

%glr-parser
%union { char *ptr; }
%type <ptr> start

%%

start:
    %dprec 2 { $$ = garbage; YYACCEPT; }
  | %dprec 1 { $$ = garbage; YYACCEPT; }
  ;

%%

static void
yyerror (char const *msg)
{
  fprintf (stderr, "%s\n", msg);
}

static int
yylex (void)
{
  static int called;
  if (called++)
    abort ();
  return 0;
}

int
main (void)
{
  int i;
  for (i = 0; i < GARBAGE_SIZE; i+=1)
    garbage[i] = 108;
  return yyparse ();
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/glr-regression.at:911: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o glr-regr10.c glr-regr10.y"
at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:911"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o glr-regr10.c glr-regr10.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:911"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:911: bison --xml=xml-tests/test.xml -o glr-regr10.c glr-regr10.y"
at_fn_check_prepare_trace "glr-regression.at:911"
( $at_check_trace; bison --xml=xml-tests/test.xml -o glr-regr10.c glr-regr10.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:911"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:911: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:911"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:911"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:911: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:911"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:911"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:911: bison -o glr-regr10.c glr-regr10.y"
at_fn_check_prepare_trace "glr-regression.at:911"
( $at_check_trace; bison -o glr-regr10.c glr-regr10.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "glr-regr10.y: conflicts: 1 reduce/reduce
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:911"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:914: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr10 glr-regr10.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr10 glr-regr10.c $LIBS" "glr-regression.at:914"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr10 glr-regr10.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:914"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/glr-regression.at:916:  \$PREPARSER ./glr-regr10"
at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr10" "glr-regression.at:916"
( $at_check_trace;  $PREPARSER ./glr-regr10
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:916"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_232
#AT_START_233
# 233. glr-regression.at:925: Undesirable destructors if user action cuts parse
at_setup_line='glr-regression.at:925'
at_fn_banner 21
at_desc="Undesirable destructors if user action cuts parse"
at_desc_line="233: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "233. glr-regression.at:925: testing ..."
  $at_traceon


cat >glr-regr11.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%{
# include <stdlib.h>
  static void yyerror (char const *);
  static int yylex (void);
  static int destructors = 0;
# define USE(val)
%}

%glr-parser
%union { int dummy; }
%type <int> 'a'
%destructor { destructors += 1; } 'a'

%%

start:
    'a' %dprec 2 { USE ($1); destructors += 1; YYACCEPT; }
  | 'a' %dprec 1 { USE ($1); destructors += 1; YYACCEPT; }
  ;

%%

static void
yyerror (char const *msg)
{
  fprintf (stderr, "%s\n", msg);
}

static int
yylex (void)
{
  static char const input[] = "a";
  static size_t toknum;
  if (! (toknum < sizeof input))
    abort ();
  return input[toknum++];
}

int
main (void)
{
  int exit_status = yyparse ();
  if (destructors != 1)
    {
      fprintf (stderr, "Destructor calls: %d\n", destructors);
      return 1;
    }
  return exit_status;
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/glr-regression.at:980: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o glr-regr11.c glr-regr11.y"
at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:980"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o glr-regr11.c glr-regr11.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:980"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:980: bison --xml=xml-tests/test.xml -o glr-regr11.c glr-regr11.y"
at_fn_check_prepare_trace "glr-regression.at:980"
( $at_check_trace; bison --xml=xml-tests/test.xml -o glr-regr11.c glr-regr11.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:980"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:980: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:980"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:980"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:980: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:980"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:980"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:980: bison -o glr-regr11.c glr-regr11.y"
at_fn_check_prepare_trace "glr-regression.at:980"
( $at_check_trace; bison -o glr-regr11.c glr-regr11.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "glr-regr11.y: conflicts: 1 reduce/reduce
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:980"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:983: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr11 glr-regr11.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr11 glr-regr11.c $LIBS" "glr-regression.at:983"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr11 glr-regr11.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:983"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/glr-regression.at:985:  \$PREPARSER ./glr-regr11"
at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr11" "glr-regression.at:985"
( $at_check_trace;  $PREPARSER ./glr-regr11
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:985"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_233
#AT_START_234
# 234. glr-regression.at:994: Leaked semantic values if user action cuts parse
at_setup_line='glr-regression.at:994'
at_fn_banner 21
at_desc="Leaked semantic values if user action cuts parse"
at_desc_line="234: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "234. glr-regression.at:994: testing ..."
  $at_traceon


cat >glr-regr12.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%glr-parser
%union { int dummy; }
%token PARENT_RHS_AFTER
%type <dummy> parent_rhs_before merged PARENT_RHS_AFTER
%destructor { parent_rhs_before_value = 0; } parent_rhs_before
%destructor { merged_value = 0; } merged
%destructor { parent_rhs_after_value = 0; } PARENT_RHS_AFTER

%{
# include <stdlib.h>
  static int merge (YYSTYPE, YYSTYPE);
  static void yyerror (char const *);
  static int yylex (void);
  static int parent_rhs_before_value = 0;
  static int merged_value = 0;
  static int parent_rhs_after_value = 0;
# define USE(val)
%}

%%

start:
  alt1 %dprec 1
  | alt2 %dprec 2
  ;

alt1:
  PARENT_RHS_AFTER {
    USE ($1);
    parent_rhs_after_value = 0;
  }
  ;

alt2:
  parent_rhs_before merged PARENT_RHS_AFTER {
    USE (($1, $2, $3));
    parent_rhs_before_value = 0;
    merged_value = 0;
    parent_rhs_after_value = 0;
  }
  ;

parent_rhs_before:
  {
    USE ($$);
    parent_rhs_before_value = 1;
  }
  ;

merged:
  %merge<merge> {
    USE ($$);
    merged_value = 1;
  }
  | cut %merge<merge> {
    USE ($$);
    merged_value = 1;
  }
  ;

cut: { YYACCEPT; } ;

%%

static int
merge (YYSTYPE s1, YYSTYPE s2)
{
  /* Not invoked. */
  char dummy = s1.dummy + s2.dummy;
  return dummy;
}

static void
yyerror (char const *msg)
{
  fprintf (stderr, "%s\n", msg);
}

static int
yylex (void)
{
  static int const input[] = { PARENT_RHS_AFTER, 0 };
  static size_t toknum;
  if (! (toknum < sizeof input / sizeof *input))
    abort ();
  if (input[toknum] == PARENT_RHS_AFTER)
    parent_rhs_after_value = 1;
  return input[toknum++];
}

int
main (void)
{
  int exit_status = yyparse ();
  if (parent_rhs_before_value)
    {
      fprintf (stderr, "`parent_rhs_before' destructor not called.\n");
      exit_status = 1;
    }
  if (merged_value)
    {
      fprintf (stderr, "`merged' destructor not called.\n");
      exit_status = 1;
    }
  if (parent_rhs_after_value)
    {
      fprintf (stderr, "`PARENT_RHS_AFTER' destructor not called.\n");
      exit_status = 1;
    }
  return exit_status;
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1111: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o glr-regr12.c glr-regr12.y"
at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:1111"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o glr-regr12.c glr-regr12.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1111"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:1111: bison --xml=xml-tests/test.xml -o glr-regr12.c glr-regr12.y"
at_fn_check_prepare_trace "glr-regression.at:1111"
( $at_check_trace; bison --xml=xml-tests/test.xml -o glr-regr12.c glr-regr12.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1111"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1111: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1111"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1111"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1111: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1111"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1111"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:1111: bison -o glr-regr12.c glr-regr12.y"
at_fn_check_prepare_trace "glr-regression.at:1111"
( $at_check_trace; bison -o glr-regr12.c glr-regr12.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "glr-regr12.y: conflicts: 1 shift/reduce, 1 reduce/reduce
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1111"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:1114: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr12 glr-regr12.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr12 glr-regr12.c $LIBS" "glr-regression.at:1114"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr12 glr-regr12.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1114"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/glr-regression.at:1116:  \$PREPARSER ./glr-regr12"
at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr12" "glr-regression.at:1116"
( $at_check_trace;  $PREPARSER ./glr-regr12
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1116"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_234
#AT_START_235
# 235. glr-regression.at:1127: Incorrect lookahead during deterministic GLR
at_setup_line='glr-regression.at:1127'
at_fn_banner 21
at_desc="Incorrect lookahead during deterministic GLR"
at_desc_line="235: $at_desc   "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "235. glr-regression.at:1127: testing ..."
  $at_traceon


cat >glr-regr13.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


/* Tests:
     - Defaulted state with initial yychar: yychar == YYEMPTY.
     - Nondefaulted state: yychar != YYEMPTY.
     - Defaulted state after lookahead: yychar != YYEMPTY.
     - Defaulted state after shift: yychar == YYEMPTY.
     - User action changing the lookahead.  */

%{
  #include <stdio.h>
  static void yyerror (char const *);
  static int yylex (void);
  static void print_lookahead (char const *);
  #define USE(value)
%}

%union { char value; }
%type <value> 'a' 'b'
%glr-parser
%locations

%%

start:
  defstate_init defstate_shift 'b' change_lookahead 'a' {
    USE ($3);
    print_lookahead ("start <- defstate_init defstate_shift 'b'");
  }
  ;
defstate_init:
  {
    print_lookahead ("defstate_init <- empty string");
  }
  ;
defstate_shift:
  nondefstate defstate_look 'a' {
    USE ($3);
    print_lookahead ("defstate_shift <- nondefstate defstate_look 'a'");
  }
  ;
defstate_look:
  {
    print_lookahead ("defstate_look <- empty string");
  }
  ;
nondefstate:
  {
    print_lookahead ("nondefstate <- empty string");
  }
  | 'b' {
    USE ($1);
    print_lookahead ("nondefstate <- 'b'");
  }
  ;
change_lookahead:
  {
    yychar = 'a';
  }
  ;

%%

static void
yyerror (char const *msg)
{
  fprintf (stderr, "%s\n", msg);
}

static int
yylex (void)
{
  static char const input[] = "ab";
  static size_t toknum;
  if (! (toknum < sizeof input))
    abort ();
  yylloc.first_line = yylloc.last_line = 1;
  yylloc.first_column = yylloc.last_column = toknum + 1;
  yylval.value = input[toknum] + 'A' - 'a';
  return input[toknum++];
}

static void
print_lookahead (char const *reduction)
{
  printf ("%s:\n  yychar=", reduction);
  if (yychar == YYEMPTY)
    printf ("YYEMPTY");
  else if (yychar == YYEOF)
    printf ("YYEOF");
  else
    {
      printf ("'%c', yylval='", yychar);
      if (yylval.value > ' ')
	printf ("%c", yylval.value);
      printf ("', yylloc=(%d,%d),(%d,%d)",
	      yylloc.first_line, yylloc.first_column,
	      yylloc.last_line, yylloc.last_column);
    }
  printf ("\n");
}

int
main (void)
{
  yychar = '#'; /* Not a token in the grammar.  */
  yylval.value = '!';
  return yyparse ();
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1240: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o glr-regr13.c glr-regr13.y"
at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:1240"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o glr-regr13.c glr-regr13.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1240"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:1240: bison --xml=xml-tests/test.xml -o glr-regr13.c glr-regr13.y"
at_fn_check_prepare_trace "glr-regression.at:1240"
( $at_check_trace; bison --xml=xml-tests/test.xml -o glr-regr13.c glr-regr13.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1240"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1240: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1240"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1240"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1240: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1240"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1240"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:1240: bison -o glr-regr13.c glr-regr13.y"
at_fn_check_prepare_trace "glr-regression.at:1240"
( $at_check_trace; bison -o glr-regr13.c glr-regr13.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1240"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:1241: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr13 glr-regr13.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr13 glr-regr13.c $LIBS" "glr-regression.at:1241"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr13 glr-regr13.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1241"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/glr-regression.at:1243:  \$PREPARSER ./glr-regr13"
at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr13" "glr-regression.at:1243"
( $at_check_trace;  $PREPARSER ./glr-regr13
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "defstate_init <- empty string:
  yychar=YYEMPTY
nondefstate <- empty string:
  yychar='a', yylval='A', yylloc=(1,1),(1,1)
defstate_look <- empty string:
  yychar='a', yylval='A', yylloc=(1,1),(1,1)
defstate_shift <- nondefstate defstate_look 'a':
  yychar=YYEMPTY
start <- defstate_init defstate_shift 'b':
  yychar=YYEMPTY
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1243"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_235
#AT_START_236
# 236. glr-regression.at:1263: Incorrect lookahead during nondeterministic GLR
at_setup_line='glr-regression.at:1263'
at_fn_banner 21
at_desc="Incorrect lookahead during nondeterministic GLR"
at_desc_line="236: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "236. glr-regression.at:1263: testing ..."
  $at_traceon


cat >glr-regr14.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


/* Tests:
     - Conflicting actions (split-off parse, which copies lookahead need,
       which is necessarily yytrue) and nonconflicting actions (non-split-off
       parse) for nondefaulted state: yychar != YYEMPTY.
     - Merged deferred actions (lookahead need and RHS from different stack
       than the target state) and nonmerged deferred actions (same stack).
     - Defaulted state after lookahead: yychar != YYEMPTY.
     - Defaulted state after shift: yychar == YYEMPTY.
     - yychar != YYEMPTY but lookahead need is yyfalse (a previous stack has
       seen the lookahead but current stack has not).
     - Exceeding stack capacity (stack explosion), and thus reallocating
       lookahead need array.
   Note that it does not seem possible to see the initial yychar value during
   nondeterministic operation since:
     - In order to preserve the initial yychar, only defaulted states may be
       entered.
     - If only defaulted states are entered, there are no conflicts, so
       nondeterministic operation does not start.  */

%union { char value; }

%{
  #include <stdlib.h>
  #include <stdio.h>
  static void yyerror (char const *);
  static int yylex (void);
  static void print_lookahead (char const *);
  static char merge (union YYSTYPE, union YYSTYPE);
  #define USE(value)
%}

%type <value> 'a' 'b' 'c' 'd' stack_explosion
%glr-parser
%locations

%%

start:
  merge 'c' stack_explosion {
    USE ($2); USE ($3);
    print_lookahead ("start <- merge 'c' stack_explosion");
  }
  ;

/* When merging the 2 deferred actions, the lookahead needs are different.  */
merge:
  nonconflict1 'a' 'b' nonconflict2 %dprec 1 {
    USE ($2); USE ($3);
    print_lookahead ("merge <- nonconflict1 'a' 'b' nonconflict2");
  }
  | conflict defstate_look 'a' nonconflict2 'b' defstate_shift %dprec 2 {
    USE ($3); USE ($5);
    print_lookahead ("merge <- conflict defstate_look 'a' nonconflict2 'b'"
		      " defstate_shift");
  }
  ;

nonconflict1:
  {
    print_lookahead ("nonconflict1 <- empty string");
  }
  ;
nonconflict2:
  {
    print_lookahead ("nonconflict2 <- empty string");
  }
  | 'a' {
    USE ($1);
    print_lookahead ("nonconflict2 <- 'a'");
  }
  ;
conflict:
  {
    print_lookahead ("conflict <- empty string");
  }
  ;
defstate_look:
  {
    print_lookahead ("defstate_look <- empty string");
  }
  ;

/* yychar != YYEMPTY but lookahead need is yyfalse.  */
defstate_shift:
  {
    print_lookahead ("defstate_shift <- empty string");
  }
  ;

stack_explosion:
  { $$ = '\0'; }
  | alt1 stack_explosion %merge<merge> { $$ = $2; }
  | alt2 stack_explosion %merge<merge> { $$ = $2; }
  | alt3 stack_explosion %merge<merge> { $$ = $2; }
  ;
alt1:
  'd' no_look {
    USE ($1);
    if (yychar != 'd' && yychar != YYEOF)
      {
	fprintf (stderr, "Incorrect lookahead during stack explosion.\n");
      }
  }
  ;
alt2:
  'd' no_look {
    USE ($1);
    if (yychar != 'd' && yychar != YYEOF)
      {
	fprintf (stderr, "Incorrect lookahead during stack explosion.\n");
      }
  }
  ;
alt3:
  'd' no_look {
    USE ($1);
    if (yychar != 'd' && yychar != YYEOF)
      {
	fprintf (stderr, "Incorrect lookahead during stack explosion.\n");
      }
  }
  ;
no_look:
  {
    if (yychar != YYEMPTY)
      {
	fprintf (stderr,
		 "Found lookahead where shouldn't during stack explosion.\n");
      }
  }
  ;

%%

static void
yyerror (char const *msg)
{
  fprintf (stderr, "%s\n", msg);
}

static int
yylex (void)
{
  static char const input[] = "abcdddd";
  static size_t toknum;
  if (! (toknum < sizeof input))
    abort ();
  yylloc.first_line = yylloc.last_line = 1;
  yylloc.first_column = yylloc.last_column = toknum + 1;
  yylval.value = input[toknum] + 'A' - 'a';
  return input[toknum++];
}

static void
print_lookahead (char const *reduction)
{
  printf ("%s:\n  yychar=", reduction);
  if (yychar == YYEMPTY)
    printf ("YYEMPTY");
  else if (yychar == YYEOF)
    printf ("YYEOF");
  else
    {
      printf ("'%c', yylval='", yychar);
      if (yylval.value > ' ')
	printf ("%c", yylval.value);
      printf ("', yylloc=(%d,%d),(%d,%d)",
	      yylloc.first_line, yylloc.first_column,
	      yylloc.last_line, yylloc.last_column);
    }
  printf ("\n");
}

static char
merge (union YYSTYPE s1, union YYSTYPE s2)
{
  char dummy = s1.value + s2.value;
  return dummy;
}

int
main (void)
{
  yychar = '#'; /* Not a token in the grammar.  */
  yylval.value = '!';
  return yyparse ();
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1456: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o glr-regr14.c glr-regr14.y"
at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:1456"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o glr-regr14.c glr-regr14.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1456"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:1456: bison --xml=xml-tests/test.xml -o glr-regr14.c glr-regr14.y"
at_fn_check_prepare_trace "glr-regression.at:1456"
( $at_check_trace; bison --xml=xml-tests/test.xml -o glr-regr14.c glr-regr14.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1456"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1456: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1456"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1456"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1456: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1456"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1456"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:1456: bison -o glr-regr14.c glr-regr14.y"
at_fn_check_prepare_trace "glr-regression.at:1456"
( $at_check_trace; bison -o glr-regr14.c glr-regr14.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "glr-regr14.y: conflicts: 3 reduce/reduce
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1456"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:1459: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr14 glr-regr14.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr14 glr-regr14.c $LIBS" "glr-regression.at:1459"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr14 glr-regr14.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1459"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/glr-regression.at:1461:  \$PREPARSER ./glr-regr14"
at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr14" "glr-regression.at:1461"
( $at_check_trace;  $PREPARSER ./glr-regr14
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; $as_echo "conflict <- empty string:
  yychar='a', yylval='A', yylloc=(1,1),(1,1)
defstate_look <- empty string:
  yychar='a', yylval='A', yylloc=(1,1),(1,1)
nonconflict2 <- empty string:
  yychar='b', yylval='B', yylloc=(1,2),(1,2)
defstate_shift <- empty string:
  yychar=YYEMPTY
merge <- conflict defstate_look 'a' nonconflict2 'b' defstate_shift:
  yychar=YYEMPTY
start <- merge 'c' stack_explosion:
  yychar=YYEOF
" | \
  $at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1461"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_236
#AT_START_237
# 237. glr-regression.at:1483: Leaked semantic values when reporting ambiguity
at_setup_line='glr-regression.at:1483'
at_fn_banner 21
at_desc="Leaked semantic values when reporting ambiguity"
at_desc_line="237: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "237. glr-regression.at:1483: testing ..."
  $at_traceon


cat >glr-regr15.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%glr-parser
%destructor { parent_rhs_before_value = 0; } parent_rhs_before

%{
# include <stdlib.h>
  static void yyerror (char const *);
  static int yylex (void);
  static int parent_rhs_before_value = 0;
# define USE(val)
%}

%%

start:
  alt1 %dprec 1
  | alt2 %dprec 2
  ;

/* This stack must be merged into the other stacks *last* (added at the
   beginning of the semantic options list) so that yyparse will choose to clean
   it up rather than the tree for which some semantic actions have been
   performed.  Thus, if yyreportAmbiguity longjmp's to yyparse, the values from
   those other trees are not cleaned up.  */
alt1: ;

alt2:
  parent_rhs_before ambiguity {
    USE ($1);
    parent_rhs_before_value = 0;
  }
  ;

parent_rhs_before:
  {
    USE ($$);
    parent_rhs_before_value = 1;
  }
  ;

ambiguity: ambiguity1 | ambiguity2 ;
ambiguity1: ;
ambiguity2: ;

%%

static void
yyerror (char const *msg)
{
  fprintf (stderr, "%s\n", msg);
}

static int
yylex (void)
{
  static int called;
  if (called++)
    abort ();
  return 0;
}

int
main (void)
{
  int exit_status = yyparse () != 1;
  if (parent_rhs_before_value)
    {
      fprintf (stderr, "`parent_rhs_before' destructor not called.\n");
      exit_status = 1;
    }
  return exit_status;
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1560: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o glr-regr15.c glr-regr15.y"
at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:1560"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o glr-regr15.c glr-regr15.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1560"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:1560: bison --xml=xml-tests/test.xml -o glr-regr15.c glr-regr15.y"
at_fn_check_prepare_trace "glr-regression.at:1560"
( $at_check_trace; bison --xml=xml-tests/test.xml -o glr-regr15.c glr-regr15.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1560"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1560: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1560"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1560"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1560: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1560"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1560"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:1560: bison -o glr-regr15.c glr-regr15.y"
at_fn_check_prepare_trace "glr-regression.at:1560"
( $at_check_trace; bison -o glr-regr15.c glr-regr15.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "glr-regr15.y: conflicts: 2 reduce/reduce
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1560"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:1563: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr15 glr-regr15.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr15 glr-regr15.c $LIBS" "glr-regression.at:1563"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr15 glr-regr15.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1563"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/glr-regression.at:1565:  \$PREPARSER ./glr-regr15"
at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr15" "glr-regression.at:1565"
( $at_check_trace;  $PREPARSER ./glr-regr15
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "syntax is ambiguous
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1565"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_237
#AT_START_238
# 238. glr-regression.at:1576: Leaked lookahead after nondeterministic parse syntax error
at_setup_line='glr-regression.at:1576'
at_fn_banner 21
at_desc="Leaked lookahead after nondeterministic parse syntax error"
at_desc_line="238: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "238. glr-regression.at:1576: testing ..."
  $at_traceon

cat >glr-regr16.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%glr-parser
%destructor { lookahead_value = 0; } 'b'

%{
# include <stdlib.h>
  static void yyerror (char const *);
  static int yylex (void);
  static int lookahead_value = 0;
# define USE(val)
%}

%%

start: alt1 'a' | alt2 'a' ;
alt1: ;
alt2: ;

%%

static void
yyerror (char const *msg)
{
  fprintf (stderr, "%s\n", msg);
}

static int
yylex (void)
{
  static char const input[] = "ab";
  static size_t toknum;
  if (! (toknum < sizeof input))
    abort ();
  if (input[toknum] == 'b')
    lookahead_value = 1;
  return input[toknum++];
}

int
main (void)
{
  int exit_status = yyparse () != 1;
  if (lookahead_value)
    {
      fprintf (stderr, "Lookahead destructor not called.\n");
      exit_status = 1;
    }
  return exit_status;
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1629: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o glr-regr16.c glr-regr16.y"
at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:1629"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o glr-regr16.c glr-regr16.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1629"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:1629: bison --xml=xml-tests/test.xml -o glr-regr16.c glr-regr16.y"
at_fn_check_prepare_trace "glr-regression.at:1629"
( $at_check_trace; bison --xml=xml-tests/test.xml -o glr-regr16.c glr-regr16.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1629"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1629: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1629"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1629"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1629: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1629"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1629"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:1629: bison -o glr-regr16.c glr-regr16.y"
at_fn_check_prepare_trace "glr-regression.at:1629"
( $at_check_trace; bison -o glr-regr16.c glr-regr16.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "glr-regr16.y: conflicts: 1 reduce/reduce
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1629"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:1632: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr16 glr-regr16.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr16 glr-regr16.c $LIBS" "glr-regression.at:1632"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr16 glr-regr16.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1632"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/glr-regression.at:1634:  \$PREPARSER ./glr-regr16"
at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr16" "glr-regression.at:1634"
( $at_check_trace;  $PREPARSER ./glr-regr16
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "syntax error
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1634"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_238
#AT_START_239
# 239. glr-regression.at:1645: Uninitialized location when reporting ambiguity
at_setup_line='glr-regression.at:1645'
at_fn_banner 21
at_desc="Uninitialized location when reporting ambiguity"
at_desc_line="239: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "239. glr-regression.at:1645: testing ..."
  $at_traceon

cat >glr-regr17.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%glr-parser
%locations
%define api.pure
%error-verbose

%union { int dummy; }

%{
  static void yyerror (YYLTYPE *, char const *);
  static int yylex (YYSTYPE *, YYLTYPE *);
%}

%initial-action {
  @$.first_line = 1;
  @$.first_column = 1;
  @$.last_line = 1;
  @$.last_column = 1;
}

%%

/* Tests the case of an empty RHS that has inherited the location of the
   previous nonterminal, which is unresolved.  That location is reported as the
   last position of the ambiguity.  */
start: ambig1 empty1 | ambig2 empty2 ;

/* Tests multiple levels of yyresolveLocations recursion.  */
ambig1: sub_ambig1 | sub_ambig2 ;
ambig2: sub_ambig1 | sub_ambig2 ;

/* Tests the case of a non-empty RHS as well as the case of an empty RHS that
   has inherited the initial location.  The empty RHS's location is reported as
   the first position in the ambiguity.  */
sub_ambig1: empty1 'a' 'b' ;
sub_ambig2: empty2 'a' 'b' ;
empty1: ;
empty2: ;

%%

static void
yyerror (YYLTYPE *locp, char const *msg)
{
  fprintf (stderr, "Error at %d.%d-%d.%d: %s.\n", locp->first_line,
	   locp->first_column, locp->last_line, locp->last_column, msg);
}

static int
yylex (YYSTYPE *lvalp, YYLTYPE *llocp)
{
  static char const input[] = "ab";
  static size_t toknum;
  if (! (toknum < sizeof input))
    abort ();
  lvalp->dummy = 0;
  llocp->first_line = llocp->last_line = 2;
  llocp->first_column = toknum + 1;
  llocp->last_column = llocp->first_column + 1;
  return input[toknum++];
}

int
main (void)
{
  return yyparse () != 1;
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1716: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o glr-regr17.c glr-regr17.y"
at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:1716"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o glr-regr17.c glr-regr17.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1716"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/glr-regression.at:1716: bison --xml=xml-tests/test.xml -o glr-regr17.c glr-regr17.y"
at_fn_check_prepare_trace "glr-regression.at:1716"
( $at_check_trace; bison --xml=xml-tests/test.xml -o glr-regr17.c glr-regr17.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1716"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1716: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1716"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1716"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/glr-regression.at:1716: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "glr-regression.at:1716"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1716"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/glr-regression.at:1716: bison -o glr-regr17.c glr-regr17.y"
at_fn_check_prepare_trace "glr-regression.at:1716"
( $at_check_trace; bison -o glr-regr17.c glr-regr17.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "glr-regr17.y: conflicts: 3 reduce/reduce
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1716"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/glr-regression.at:1719: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o glr-regr17 glr-regr17.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr17 glr-regr17.c $LIBS" "glr-regression.at:1719"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o glr-regr17 glr-regr17.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1719"
$at_failed && at_fn_log_failure
$at_traceon; }


{ set +x
$as_echo "$at_srcdir/glr-regression.at:1721:  \$PREPARSER ./glr-regr17"
at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr17" "glr-regression.at:1721"
( $at_check_trace;  $PREPARSER ./glr-regr17
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "Error at 1.1-2.3: syntax is ambiguous.
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1721"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_239
#AT_START_240
# 240. glr-regression.at:1732: Missed %merge type warnings when LHS type is declared later
at_setup_line='glr-regression.at:1732'
at_fn_banner 21
at_desc="Missed %merge type warnings when LHS type is declared later"
at_desc_line="240: $at_desc"
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "240. glr-regression.at:1732: testing ..."
  $at_traceon

cat >glr-regr18.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}

%glr-parser

%{
  #include <stdlib.h>
  static void yyerror (char const *);
  static int yylex ();
%}

%union {
  int type1;
  int type2;
  int type3;
}

%%

sym1: sym2 %merge<merge> { $$ = $1; } ;
sym2: sym3 %merge<merge> { $$ = $1; } ;
sym3: %merge<merge> { $$ = 0; } ;

%type <type1> sym1;
%type <type2> sym2;
%type <type3> sym3;

%%

static void
yyerror (char const *msg)
{
  fprintf (stderr, "%s\n", msg);
}

static int
yylex ()
{
  static int called;
  if (called++)
    abort ();
  return 0;
}

int
main (void)
{
  return yyparse ();
}
_ATEOF




{ set +x
$as_echo "$at_srcdir/glr-regression.at:1782: VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o glr-regr18.c glr-regr18.y"
at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison -o glr-regr18.c glr-regr18.y" "glr-regression.at:1782"
( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison -o glr-regr18.c glr-regr18.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "glr-regr18.y:26.18-24: result type clash on merge function \`merge': <type2> != <type1>
glr-regr18.y:25.18-24: previous declaration
glr-regr18.y:27.13-19: result type clash on merge function \`merge': <type3> != <type2>
glr-regr18.y:26.18-24: previous declaration
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:1782"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_240
#AT_START_241
# 241. push.at:23: Memory Leak for Early Deletion
at_setup_line='push.at:23'
at_fn_banner 22
at_desc="Memory Leak for Early Deletion"
at_desc_line="241: $at_desc                 "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "241. push.at:23: testing ..."
  $at_traceon


# Requires Valgrind.

cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%{
  #include <assert.h>
  #include <stdio.h>
  #define YYINITDEPTH 1
  void yyerror (char const *msg);
%}

%define api.pure %define api.push_pull "push"

%%

start: 'a' 'b' 'c' ;

%%

void
yyerror (char const *msg)
{
  fprintf (stderr, "%s\n", msg);
}

int
main (void)
{
  yypstate *ps;

  /* Make sure we don't try to free ps->yyss in this case.  */
  ps = yypstate_new ();
  yypstate_delete (ps);

  /* yypstate_delete used to leak ps->yyss if the stack was reallocated but the
     parse did not return on success, syntax error, or memory exhaustion.  */
  ps = yypstate_new ();
  assert (yypush_parse (ps, 'a', NULL) == YYPUSH_MORE);
  yypstate_delete (ps);

  ps = yypstate_new ();
  assert (yypush_parse (ps, 'a', NULL) == YYPUSH_MORE);
  assert (yypush_parse (ps, 'b', NULL) == YYPUSH_MORE);
  yypstate_delete (ps);

  return 0;
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/push.at:74: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "push.at:74"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/push.at:74"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/push.at:74: bison --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_trace "push.at:74"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/push.at:74"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/push.at:74: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "push.at:74"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/push.at:74"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/push.at:74: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "push.at:74"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/push.at:74"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/push.at:74: bison -o input.c input.y"
at_fn_check_prepare_trace "push.at:74"
( $at_check_trace; bison -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/push.at:74"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/push.at:75: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "push.at:75"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/push.at:75"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/push.at:76:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "push.at:76"
( $at_check_trace;  $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/push.at:76"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_241
#AT_START_242
# 242. push.at:84: Multiple impure instances
at_setup_line='push.at:84'
at_fn_banner 22
at_desc="Multiple impure instances"
at_desc_line="242: $at_desc                      "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "242. push.at:84: testing ..."
  $at_traceon





cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%{
  #include <assert.h>
  #include <stdio.h>
  void yyerror (char const *msg);
  int yylex (void);
%}

%define api.push_pull "both"

%%

start: ;

%%

void
yyerror (char const *msg)
{
  fprintf (stderr, "%s\n", msg);
}

int
yylex (void)
{
  return 0;
}

int
main (void)
{
  yypstate *ps;
  int i;

  for (i = 0; i < 2; ++i)
    {
      ps = yypstate_new ();
      assert (ps);
      assert (yypstate_new () == NULL);
      assert (yyparse () == 2);
      yychar = 0;
      assert (yypush_parse (ps) == 0);
      assert (yypstate_new () == NULL);
      assert (yyparse () == 2);
      yypstate_delete (ps);
    }

  return 0;
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/push.at:144: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "push.at:144"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/push.at:144"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/push.at:144: bison --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_trace "push.at:144"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/push.at:144"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/push.at:144: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "push.at:144"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/push.at:144"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/push.at:144: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "push.at:144"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/push.at:144"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/push.at:144: bison -o input.c input.y"
at_fn_check_prepare_trace "push.at:144"
( $at_check_trace; bison -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/push.at:144"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/push.at:144: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "push.at:144"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/push.at:144"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/push.at:144:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "push.at:144"
( $at_check_trace;  $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/push.at:144"
$at_failed && at_fn_log_failure
$at_traceon; }



cat >input.y <<'_ATEOF'
%code top {
#include <config.h>
/* We don't need perfect functions for these tests. */
#undef malloc
#undef memcmp
#undef realloc
}


%{
  #include <assert.h>
  #include <stdio.h>
  void yyerror (char const *msg);
  int yylex (void);
%}

%define api.push_pull "push"

%%

start: ;

%%

void
yyerror (char const *msg)
{
  fprintf (stderr, "%s\n", msg);
}

int
yylex (void)
{
  return 0;
}

int
main (void)
{
  yypstate *ps;
  int i;

  for (i = 0; i < 2; ++i)
    {
      ps = yypstate_new ();
      assert (ps);
      assert (yypstate_new () == NULL);
      ;
      yychar = 0;
      assert (yypush_parse (ps) == 0);
      assert (yypstate_new () == NULL);
      ;
      yypstate_delete (ps);
    }

  return 0;
}
_ATEOF



if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/push.at:145: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "push.at:145"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/push.at:145"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/push.at:145: bison --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_trace "push.at:145"
( $at_check_trace; bison --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/push.at:145"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/push.at:145: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "push.at:145"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/push.at:145"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/push.at:145: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "push.at:145"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/push.at:145"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/push.at:145: bison -o input.c input.y"
at_fn_check_prepare_trace "push.at:145"
( $at_check_trace; bison -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/push.at:145"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/push.at:145: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "push.at:145"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/push.at:145"
$at_failed && at_fn_log_failure
$at_traceon; }

{ set +x
$as_echo "$at_srcdir/push.at:145:  \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "push.at:145"
( $at_check_trace;  $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/push.at:145"
$at_failed && at_fn_log_failure
$at_traceon; }





  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_242
#AT_START_243
# 243. push.at:155: Unsupported Skeletons
at_setup_line='push.at:155'
at_fn_banner 22
at_desc="Unsupported Skeletons"
at_desc_line="243: $at_desc                          "
$at_quiet $as_echo_n "$at_desc_line"
at_xfail=no
echo "#                             -*- compilation -*-" >> "$at_group_log"
(
  $as_echo "243. push.at:155: testing ..."
  $at_traceon


cat >input.y <<'_ATEOF'
%glr-parser
%define api.push_pull "push"
%%
start: ;
_ATEOF


if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
  mkdir xml-tests
    # Don't combine these Bison invocations since we want to be sure that
  # --report=all isn't required to get the full XML file.
  { set +x
$as_echo "$at_srcdir/push.at:164: bison --report=all --report-file=xml-tests/test.output \\
             --graph=xml-tests/test.dot input.y"
at_fn_check_prepare_notrace 'an embedded newline' "push.at:164"
( $at_check_trace; bison --report=all --report-file=xml-tests/test.output \
             --graph=xml-tests/test.dot input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/push.at:164"
$at_failed && at_fn_log_failure
$at_traceon; }

  { set +x
$as_echo "$at_srcdir/push.at:164: bison --xml=xml-tests/test.xml input.y"
at_fn_check_prepare_trace "push.at:164"
( $at_check_trace; bison --xml=xml-tests/test.xml input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/push.at:164"
$at_failed && at_fn_log_failure
$at_traceon; }

    cp xml-tests/test.output expout
  { set +x
$as_echo "$at_srcdir/push.at:164: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "push.at:164"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/push.at:164"
$at_failed && at_fn_log_failure
$at_traceon; }

  cp xml-tests/test.dot expout
  { set +x
$as_echo "$at_srcdir/push.at:164: \$XSLTPROC \\
             \`VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
             xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "push.at:164"
( $at_check_trace; $XSLTPROC \
             `VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
             xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/push.at:164"
$at_failed && at_fn_log_failure
$at_traceon; }

  rm -rf xml-tests expout
fi
{ set +x
$as_echo "$at_srcdir/push.at:164: bison input.y"
at_fn_check_prepare_trace "push.at:164"
( $at_check_trace; bison input.y
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; $as_echo "input.y:2.9-21: warning: %define variable \`api.push_pull' is not used
" | \
  $at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/push.at:164"
$at_failed && at_fn_log_failure
$at_traceon; }


  set +x
  $at_times_p && times >"$at_times_file"
) 5>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_243
